the Cocoa window for its wxWindows parent is its Cocoa parent.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25679
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxAutoNSAutoreleasePool pool;
DestroyChildren();
- CocoaRemoveFromParent();
+ // Make sure our parent (in the wxWindows sense) is our superview
+ // before we go removing from it.
+ if(m_parent && m_parent->GetNSView()==[GetNSViewForSuperview() superview])
+ CocoaRemoveFromParent();
delete m_cocoaHider;
delete m_cocoaScroller;
SetNSView(NULL);