Here is my code:
ship.runAction(SKAction.waitForDuration(5), completion: {
self.ship.flyStraight()//retain self
})
After several days googling for the memory issues, finally I found that I had a self retain in this block. When I create the new scene before the block has run, the deinit function won't be called because the reference in the block.
I have to write in this way in my game, and what can I do to avoid this issue. What did you with code like this?