Skip to content

Commit

Permalink
Fixed bug where node was not unregistered on exit
Browse files Browse the repository at this point in the history
I found that update continued to be called for nodes that had been removed from the scene after having called removeFromParent.  I think it was originally a typo so I have updated registerComponentNode to unregisterComponentNode which corrects this behaviour and prevents update from being called after the node has been removed from the scene.
  • Loading branch information
nicholascross committed Mar 9, 2014
1 parent 0b87584 commit 339b7a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SpriteKit-Components/SKComponentNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ - (void)onExit {

// unregister self with scene
SKComponentScene* scene = SKComponentSceneForNode(self);
[scene registerComponentNode:self];
[scene unregisterComponentNode:self];

// perform onExit for all components
for (id<SKComponent> component in components) {
Expand Down

0 comments on commit 339b7a4

Please sign in to comment.