X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b886fae6484edbb3a2fdbe8be74b3a840e9c84ee..bb5b7285057aa71bd9d86aad6effb00dbfcd1f85:/src/x11/window.cpp diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 9c5f6f49b8..f10becfa7f 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -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; + } } // ---------------------------------------------------------------------------