On path completion, clear the path before observers are notified so

that they can assign a new path to the sprite should they choose to do
so.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@523 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2001-10-23 01:59:50 +00:00
parent dcf38d7a09
commit e4a101cfc2
@@ -1,5 +1,5 @@
// //
// $Id: Sprite.java,v 1.26 2001/10/22 18:13:09 shaper Exp $ // $Id: Sprite.java,v 1.27 2001/10/23 01:59:50 shaper Exp $
package com.threerings.media.sprite; package com.threerings.media.sprite;
@@ -328,11 +328,13 @@ public class Sprite
*/ */
protected void pathCompleted () protected void pathCompleted ()
{ {
// inform observers that we've finished our path // keep a reference to the path just completed
notifyObservers(new PathCompletedEvent(this, _path)); Path oldpath = _path;
// clear out the path we've now finished
// we no longer want to keep a reference to this path
_path = null; _path = null;
// inform observers that we've finished our path
notifyObservers(new PathCompletedEvent(this, oldpath));
} }
/** /**