call OnExit() even if an exception has been thrown from OnRun()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -403,13 +403,15 @@ int wxEntryReal(int& argc, wxChar **argv)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ensure that OnExit() is called if OnInit() had succeeded
|
||||||
|
class CallOnExit
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
~CallOnExit() { wxTheApp->OnExit(); }
|
||||||
|
} callOnExit;
|
||||||
|
|
||||||
// app execution
|
// app execution
|
||||||
int retValue = wxTheApp->OnRun();
|
return wxTheApp->OnRun();
|
||||||
|
|
||||||
// app clean up
|
|
||||||
wxTheApp->OnExit();
|
|
||||||
|
|
||||||
return retValue;
|
|
||||||
}
|
}
|
||||||
wxCATCH_ALL( wxTheApp->OnUnhandledException(); return -1; )
|
wxCATCH_ALL( wxTheApp->OnUnhandledException(); return -1; )
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user