jocelynlih/SwiftGameBook — pull request #86 by nettlep (2014-08-24 19:25:39+00:00)
Title: It turns out there is a bug in iOS that doesn't cleanup scenes properly....

... I find this hard to believe, but the solution to our crashes proves that this is an issue (or there is a scarier systemic problem at work here.)

Incidentally, during testing, I noticed another bug - as you played the game over and over without restarting, after about 15 times through the level, it would get slower and slower and use more and more memory. The frame rate would get down to about 7FPS (and even lower if I would keep testing) and the memory footprint would reach over a GB (!!). This fix solves this problem as well.

The fix is to cleanup the currently presented scene recursively before presenting the new scene.