don't crash in dtor if the X11 window hadn't been created (patch 1640153)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-01-20 14:32:18 +00:00
parent fc9f11cc6f
commit 3aba082d50
2 changed files with 11 additions and 4 deletions

View File

@@ -357,10 +357,13 @@ wxWindowX11::~wxWindowX11()
}
// Destroy the window
Window xwindow = (Window) m_mainWindow;
wxDeleteWindowFromTable( xwindow );
XDestroyWindow( wxGlobalDisplay(), xwindow );
m_mainWindow = NULL;
if ( m_mainWindow )
{
Window xwindow = (Window) m_mainWindow;
wxDeleteWindowFromTable( xwindow );
XDestroyWindow( wxGlobalDisplay(), xwindow );
m_mainWindow = NULL;
}
}
// ---------------------------------------------------------------------------