]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/nonownedwnd_osx.cpp
Fix another line somehow missing from the wxGraphicsBitmap forward port.
[wxWidgets.git] / src / osx / nonownedwnd_osx.cpp
index 9adc5647d549121fb5de9ecb7435a6e629451920..017107215f22521e3e247c280e9dc01380018a69 100644 (file)
@@ -159,12 +159,26 @@ wxNonOwnedWindow::~wxNonOwnedWindow()
     DestroyChildren();
 
     delete m_nowpeer;
+    m_nowpeer = NULL;
 
     // avoid dangling refs
     if ( s_macDeactivateWindow == this )
         s_macDeactivateWindow = NULL;
 }
 
+bool wxNonOwnedWindow::Destroy()
+{
+    WillBeDestroyed();
+    
+    return wxWindow::Destroy();
+}
+
+void wxNonOwnedWindow::WillBeDestroyed()
+{
+    if ( m_nowpeer )
+        m_nowpeer->WillBeDestroyed();
+}
+
 // ----------------------------------------------------------------------------
 // wxNonOwnedWindow misc
 // ----------------------------------------------------------------------------