\membersection{wxApp::OnExit}\label{wxapponexit}
-\func{int}{OnExit}{\void}
+\func{virtual int}{OnExit}{\void}
-Provide this member function for any processing which needs to be
+Override this member function for any processing which needs to be
done as the application is about to exit. OnExit is called after
destroying all application windows and controls, but before
-wxWindows cleanup.
+wxWindows cleanup. Note that it is not called at all if
+\helpref{OnInit}{wxapponinit} failed.
+
+The return value of this function is currently ignored, return the same value
+as returned by the base class method if you override it.
\membersection{wxApp::OnFatalException}\label{wxapponfatalexception}
\wxheading{See also}
-\helpref{wxHandleFatalExcetions}{wxhandlefatalexceptions}
+\helpref{wxHandleFatalExceptions}{wxhandlefatalexceptions}
%% VZ: the wxApp event handler are private and should not be documented here!
%%
This must be provided by the application, and will usually create the
application's main window, optionally calling
-\helpref{wxApp::SetTopWindow}{wxappsettopwindow}.
+\helpref{wxApp::SetTopWindow}{wxappsettopwindow}. You may use
+\helpref{OnExit}{wxapponexit} to clean up anything initialized here, provided
+that the function returns \true.
Notice that if you want to to use the command line processing provided by
wxWindows you have to call the base class version in the derived class
OnInit().
-Return true to continue processing, false to exit the application.
+Return \true to continue processing, \false to exit the application
+immediately.
\membersection{wxApp::OnInitCmdLine}\label{wxapponinitcmdline}
\wxheading{See also}
\helpref{wxWindow::Close}{wxwindowclose},\rtfsp
-\helpref{wxCloseEvent}{wxcloseevent}
-%% GD: OnXXX functions are not documented
-%%\helpref{wxApp::OnEndSession}{wxapponendsession}
+\helpref{wxCloseEvent}{wxcloseevent}\rtfsp
\membersection{wxApp::OnRun}\label{wxapponrun}
\helpref{GetExitOnFrameDelete}{wxappgetexitonframedelete} flag is \true (this
is the default).
+The return value of this function becomes the exit code of the program, so it
+should return $0$ in case of successful termination.
+
\membersection{wxApp::OnUnhandledException}\label{wxapponunhandledexception}