Otherwise quite handy Perl application wizard for N9200 produces following code for AppUI-class (excerpt from app.tpl -template):
The same code is present in N9200 examples also, but SDK for Nokia 9500 includes the correct code shown below.
With Series 60 Application wizard you get following for the AppUi-destructor:
RemoveFromStack( iAppContainer );
If you don't remove container(s) before deleting them from event stack your emulator will crash after application is closed.