OnApplicationQuit() seems to be delayed

Is there a way to make OnApplicationQuit() be called sooner after you press the home button, or are there some best practices you should follow when using it?

I’ve noticed that when I restore a game state saved during OnApplicationQuit() that everything seems to have run for about a second after the game disappeared.

The very first thing I do in OnApplicationQuit() is stop the timer so I don’t think it’s that my saving routine itself takes too long.

This is only a problem on the iPhone. The desktop and webplayer versions seem to stop the game immediately.

Anyone got any ideas?

Unfortunately, OnApplicationQuit gets called whenever applicationWillTerminate gets called in Objective-C land. And applicationWillTerminate gets called after the app has done the little zoom out effect, and not immediately once the Home button is pressed.

I guess if you know Objective-C you could make some changes directly into the XCode Project generated by Unity.

I haven’t tried this, just guessing.