From 339b7a4c75fd1b26a2e918c75c53ae602575fdb7 Mon Sep 17 00:00:00 2001 From: nacrossweb Date: Sun, 9 Mar 2014 14:46:42 +1100 Subject: [PATCH] Fixed bug where node was not unregistered on exit 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. --- SpriteKit-Components/SKComponentNode.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpriteKit-Components/SKComponentNode.m b/SpriteKit-Components/SKComponentNode.m index d731fae..a0d6bb7 100644 --- a/SpriteKit-Components/SKComponentNode.m +++ b/SpriteKit-Components/SKComponentNode.m @@ -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 component in components) {