]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sizer.cpp
compilation fix for !PCH
[wxWidgets.git] / src / common / sizer.cpp
index c34e5169320dcc99198eda94b9108a85990595c8..3650a7b5b7b0ae49ce9f6648817e775725df3040 100644 (file)
@@ -94,10 +94,16 @@ wxSizerItem::wxSizerItem( wxSizer *sizer, int proportion, int flag, int border,
 
 wxSizerItem::~wxSizerItem()
 {
-    if (m_userData)
-        delete m_userData;
-    if (m_sizer)
+    delete m_userData;
+
+    if ( m_window )
+    {
+        m_window->SetContainingSizer(NULL);
+    }
+    else // we must be a sizer
+    {
         delete m_sizer;
+    }
 }