Permalink
Browse files

When removing entity from game, remove componentAdded listener before…

… removing from families - fixes #7
  • Loading branch information...
1 parent 4b5c6b7 commit 2f538a198164a5a07edb4e068f41dcd06be02356 @richardlord committed Jul 1, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/net/richardlord/ash/core/Game.as
@@ -56,11 +56,11 @@ package net.richardlord.ash.core
*/
public function removeEntity( entity : Entity ) : void
{
+ entity.componentAdded.remove( componentAdded );
for each( var family : Family in families )
{
family.remove( entity );
}
- entity.componentAdded.remove( componentAdded );
entities.remove( entity );
}

0 comments on commit 2f538a1

Please sign in to comment.