execute the usual cleanup code from EVT_END_SESSION handler under MSW, otherwise it's not run at all because we're simply killed by the system (bug 1428691)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -598,8 +598,17 @@ void wxApp::WakeUpIdle()
|
||||
|
||||
void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
|
||||
{
|
||||
if (GetTopWindow())
|
||||
GetTopWindow()->Close(true);
|
||||
// Windows will terminate the process soon after we return from
|
||||
// WM_ENDSESSION handler anyhow, so make sure we at least execute our
|
||||
// cleanup code before
|
||||
const int rc = OnExit();
|
||||
|
||||
wxEntryCleanup();
|
||||
|
||||
// calling exit() instead of ExitProcess() or not doing anything at all and
|
||||
// being killed by Windows has the advantage of executing the dtors of
|
||||
// global objects
|
||||
exit(rc);
|
||||
}
|
||||
|
||||
// Default behaviour: close the application with prompts. The
|
||||
|
Reference in New Issue
Block a user