prevent all our windows from being destroyed in wxApp::OnEndSession(), otherwise we're still killed before the cleanup code finishes to run
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -599,8 +599,15 @@ void wxApp::WakeUpIdle()
|
|||||||
void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
|
void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
// Windows will terminate the process soon after we return from
|
// Windows will terminate the process soon after we return from
|
||||||
// WM_ENDSESSION handler anyhow, so make sure we at least execute our
|
// WM_ENDSESSION handler or when we delete our last window, so make sure we
|
||||||
// cleanup code before
|
// at least execute our cleanup code before
|
||||||
|
|
||||||
|
// prevent the window from being destroyed when the corresponding wxTLW is
|
||||||
|
// destroyed: this will result in a leak of a HWND, of course, but who
|
||||||
|
// cares when the process is being killed anyhow
|
||||||
|
if ( !wxTopLevelWindows.empty() )
|
||||||
|
wxTopLevelWindows[0]->SetHWND(0);
|
||||||
|
|
||||||
const int rc = OnExit();
|
const int rc = OnExit();
|
||||||
|
|
||||||
wxEntryCleanup();
|
wxEntryCleanup();
|
||||||
|
Reference in New Issue
Block a user