SKAction.runAction () completion block memory leak (close)

I often use SKAction with a completion block and use a variable called runAction () in the completion block like this.

self.runAction(SKAction.waitForDuration(2.0)) {
    self.removeFromParent()
}

      

Does this mean maintaining the cycle? I think that if the SKNode does not have a termination variable then the loop does not save. Is it correct?

+3


source to share


1 answer


Result of my test, SKAction completion closure does not have a strong reference. Also, if I add the closure as a variable to the SKNode subclass and access itself in the closure, SKNode never called deinit ().



0


source







All Articles