How to exit application (continuation)

Hi Guys,

I’m coding for aiplay (marmalade).

I know this topic was discussed before:
http://www.cocos2d-x.org/boards/7/topics/1088

But it’s still unclear how to properly exit from application. CCDirector::sharedDirector()>end purges all data and terminates GL view but who should call exit then? How does my application know director finished purging?
void CCDirector::purgeDirector cals m_pRunningScene
>onExit() - but this is before all data cleared so I cannot call exit() in my scene::onExit().

Shouldn’t director somehow notify AppDelegate he finished purging?

Thanks,
Alex

This thread http://www.cocos2d-x.org/boards/6/topics/1335?r=7524#message-7524 may be useful for you.
We will consider to add ‘applicationWillTerminate’ in next release.