diff --git a/src/as/com/threerings/ezgame/EZGameControl.as b/src/as/com/threerings/ezgame/EZGameControl.as index 789ef754..05ddcb8c 100644 --- a/src/as/com/threerings/ezgame/EZGameControl.as +++ b/src/as/com/threerings/ezgame/EZGameControl.as @@ -613,6 +613,7 @@ public class EZGameControl extends BaseControl */ protected function populateProperties (o :Object) :void { + o["connectionClosed_v1"] = connectionClosed_v1; o["propertyWasSet_v1"] = propertyWasSet_v1; o["controlDidChange_v1"] = controlDidChange_v1; o["turnDidChange_v1"] = turnDidChange_v1; @@ -624,6 +625,14 @@ public class EZGameControl extends BaseControl o["userChat_v1"] = userChat_v1; } + /** + * Private method called when the backend disconnects from us. + */ + private function connectionClosed_v1 () :void + { + _gameData = null; + } + /** * Private method to post a PropertyChangedEvent. */ diff --git a/src/as/com/threerings/ezgame/client/GameControlBackend.as b/src/as/com/threerings/ezgame/client/GameControlBackend.as index cb6e193d..88218549 100644 --- a/src/as/com/threerings/ezgame/client/GameControlBackend.as +++ b/src/as/com/threerings/ezgame/client/GameControlBackend.as @@ -129,6 +129,7 @@ public class GameControlBackend _ctx.getChatDirector().removeChatDisplay(this); _ctx.getClient().getClientObject().removeListener(_userListener); _userFuncs = null; // disconnect + callUserCode("connectionClosed_v1"); } /**