Skip to content

Commit 339b7a4

Browse files
committed
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.
1 parent 0b87584 commit 339b7a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SpriteKit-Components/SKComponentNode.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ - (void)onExit {
153153

154154
// unregister self with scene
155155
SKComponentScene* scene = SKComponentSceneForNode(self);
156-
[scene registerComponentNode:self];
156+
[scene unregisterComponentNode:self];
157157

158158
// perform onExit for all components
159159
for (id<SKComponent> component in components) {

0 commit comments

Comments
 (0)