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:
Vadim Zeitlin
2008-04-15 23:30:15 +00:00
parent 722f74cec8
commit 9fb99466b5
2 changed files with 25 additions and 4 deletions

View File

@@ -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