]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/window.cpp
Hack to support iso8859 and other wrongly formated
[wxWidgets.git] / src / x11 / window.cpp
index 9c5f6f49b87cf537af724f28cb18972ab28d51b5..f10becfa7f72e258db529b28f37e8cf813dc7ac9 100644 (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;
+    }
 }
 
 // ---------------------------------------------------------------------------