]> git.saurik.com Git - wxWidgets.git/commitdiff
don't crash in dtor if the X11 window hadn't been created (patch 1640153)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Jan 2007 14:32:18 +0000 (14:32 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 20 Jan 2007 14:32:18 +0000 (14:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/x11/window.cpp

index edf3a0ad3b45e410897732c1f549cc12ff0f77ed..3ccc2e61a89ebdca27add1558e7a45766827927c 100644 (file)
@@ -109,6 +109,10 @@ wxMac
 
 - Added support for the wxFRAME_FLOAT_ON_PARENT style
 
+wxX11:
+
+- Don't crash in wxWindow dtor if the window hadn't been really Create()d
+
 
 2.8.1
 -----
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;
+    }
 }
 
 // ---------------------------------------------------------------------------