]> git.saurik.com Git - wxWidgets.git/commitdiff
In destructor: DestroyChildren() and make sure m_cocoaNSView is NULL so that
authorDavid Elliott <dfe@tgwbd.org>
Tue, 5 Aug 2003 15:58:39 +0000 (15:58 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Tue, 5 Aug 2003 15:58:39 +0000 (15:58 +0000)
the ~wxWindow destructor will not try to remove it from its superview (BAD!)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22594 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/toplevel.mm

index c4bfd67a419ab4a83e1a03ee9f30b43821f0f9cb..4c138ca8f05bc8d186e63a8ae63f38633c90276e 100644 (file)
@@ -98,12 +98,8 @@ bool wxTopLevelWindowCocoa::Create(wxWindow *parent,
 wxTopLevelWindowCocoa::~wxTopLevelWindowCocoa()
 {
     wxAutoNSAutoreleasePool pool;
-    // Hand ownership of the content view to wxWindow so it can destroy
-    // itself properly.
-    NSView *view = [m_cocoaNSView retain];
+    DestroyChildren();
     SetNSWindow(NULL);
-    SetNSView(view);
-    [view release];
 }
 
 // ----------------------------------------------------------------------------