applicationExit and Globals

I want to release my global variables when my game ends. Should I create a listener for applicationExit and do my cleanup there? [import]uid: 41809 topic_id: 17013 reply_id: 317013[/import]

Are you talking about when your game ends, as in a round, where your app will still be running?

Or do you mean when the user actually exits the app?

If you’re speaking of the latter, there’s really no need because if your app closes then memory is already released. When you launch your app new, it starts fresh.

I would recommend releasing things from some kind of “game over” function, before the user is able to start a new game. [import]uid: 52430 topic_id: 17013 reply_id: 63932[/import]

I meant when the user exits the app. I’ve heard so many warnings about using globals that I thought I should be a ‘good’ memory user and set all the globals to nil on the way out. [import]uid: 41809 topic_id: 17013 reply_id: 64168[/import]