]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/nonownedwnd_osx.cpp
freeze whole window for TLW
[wxWidgets.git] / src / osx / nonownedwnd_osx.cpp
index 9adc5647d549121fb5de9ecb7435a6e629451920..54ecb11f6d3e8b2125d557929a1f54d95c399ae2 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
 // ----------------------------------------------------------------------------
@@ -410,12 +424,7 @@ void wxNonOwnedWindow::DoGetClientSize( int *width, int *height ) const
         return;
 
     int left, top, w, h;
-    // perhaps we should do this for all ?
-#ifdef __WXOSX_IPHONE__
-    m_peer->GetContentArea(left, top, w, h);
-#else
     m_nowpeer->GetContentArea(left, top, w, h);
-#endif
     
     if (width)
        *width = w ;