]> git.saurik.com Git - wxWidgets.git/commitdiff
reset the associated view frame pointer when the frame is deleted directly instead...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 11 Mar 2009 16:11:54 +0000 (16:11 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 11 Mar 2009 16:11:54 +0000 (16:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59484 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/docview.h

index 610dd0c6f6dcfe35e4cfe755efd8c37f60562bf7..55fa2c792077004a88a71ae099ef238c350cb04c 100644 (file)
@@ -530,6 +530,14 @@ public:
             view->SetDocChildFrame(this);
     }
 
+    ~wxDocChildFrameAnyBase()
+    {
+        // prevent the view from deleting us if we're being deleted directly
+        // (and not via Close() + Destroy())
+        if ( m_childView )
+            m_childView->SetDocChildFrame(NULL);
+    }
+
     wxDocument *GetDocument() const { return m_childDocument; }
     wxView *GetView() const { return m_childView; }
     void SetDocument(wxDocument *doc) { m_childDocument = doc; }