Make sure that we remove ourselves as a listener even if our unknown and

untrustable derived class freaks out in gameDidEnd().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2072 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-12-16 05:31:00 +00:00
parent cbbda03e23
commit 41fe126611
@@ -1,5 +1,5 @@
//
// $Id: GameWatcher.java,v 1.1 2002/12/16 05:06:58 shaper Exp $
// $Id: GameWatcher.java,v 1.2 2002/12/16 05:31:00 mdb Exp $
package com.threerings.parlor.game;
@@ -35,10 +35,12 @@ public abstract class GameWatcher
// if we transitioned to a non-in-play state, the game has
// completed
if (!_gameobj.isInPlay()) {
gameDidEnd(_gameobj);
// clean up
_gameobj.removeListener(this);
_gameobj = null;
try {
gameDidEnd(_gameobj);
} finally {
_gameobj.removeListener(this);
_gameobj = null;
}
}
}
}