call RemoveChild() in ~wxWindowBase instead of doing it in each ~wxWindow for each port
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -281,9 +281,6 @@ wxWindow::~wxWindow()
|
|||||||
wxAutoNSAutoreleasePool pool;
|
wxAutoNSAutoreleasePool pool;
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
if(m_parent)
|
|
||||||
m_parent->RemoveChild(this);
|
|
||||||
|
|
||||||
CocoaRemoveFromParent();
|
CocoaRemoveFromParent();
|
||||||
delete m_cocoaHider;
|
delete m_cocoaHider;
|
||||||
delete m_cocoaScroller;
|
delete m_cocoaScroller;
|
||||||
|
@@ -266,6 +266,17 @@ wxWindowBase::~wxWindowBase()
|
|||||||
|
|
||||||
wxASSERT_MSG( GetChildren().GetCount() == 0, wxT("children not destroyed") );
|
wxASSERT_MSG( GetChildren().GetCount() == 0, wxT("children not destroyed") );
|
||||||
|
|
||||||
|
// reset the dangling pointer our parent window may keep to us
|
||||||
|
if ( m_parent )
|
||||||
|
{
|
||||||
|
if ( m_parent->GetDefaultItem() == this )
|
||||||
|
{
|
||||||
|
m_parent->SetDefaultItem(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_parent->RemoveChild(this);
|
||||||
|
}
|
||||||
|
|
||||||
#if wxUSE_CARET
|
#if wxUSE_CARET
|
||||||
delete m_caret;
|
delete m_caret;
|
||||||
#endif // wxUSE_CARET
|
#endif // wxUSE_CARET
|
||||||
@@ -305,12 +316,6 @@ wxWindowBase::~wxWindowBase()
|
|||||||
#if wxUSE_ACCESSIBILITY
|
#if wxUSE_ACCESSIBILITY
|
||||||
delete m_accessible;
|
delete m_accessible;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// reset the dangling pointer our parent window may keep to us
|
|
||||||
if ( m_parent && m_parent->GetDefaultItem() == this )
|
|
||||||
{
|
|
||||||
m_parent->SetDefaultItem(NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowBase::Destroy()
|
bool wxWindowBase::Destroy()
|
||||||
@@ -343,10 +348,6 @@ bool wxWindowBase::DestroyChildren()
|
|||||||
|
|
||||||
wxWindow *child = node->GetData();
|
wxWindow *child = node->GetData();
|
||||||
|
|
||||||
wxASSERT_MSG( child, wxT("children list contains empty nodes") );
|
|
||||||
|
|
||||||
child->Show(FALSE);
|
|
||||||
|
|
||||||
child->Destroy();
|
child->Destroy();
|
||||||
|
|
||||||
wxASSERT_MSG( !GetChildren().Find(child),
|
wxASSERT_MSG( !GetChildren().Find(child),
|
||||||
|
@@ -2667,9 +2667,6 @@ wxWindowGTK::~wxWindowGTK()
|
|||||||
|
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
if (m_parent)
|
|
||||||
m_parent->RemoveChild( this );
|
|
||||||
|
|
||||||
#ifdef HAVE_XIM
|
#ifdef HAVE_XIM
|
||||||
if (m_ic)
|
if (m_ic)
|
||||||
gdk_ic_destroy (m_ic);
|
gdk_ic_destroy (m_ic);
|
||||||
|
@@ -2667,9 +2667,6 @@ wxWindowGTK::~wxWindowGTK()
|
|||||||
|
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
if (m_parent)
|
|
||||||
m_parent->RemoveChild( this );
|
|
||||||
|
|
||||||
#ifdef HAVE_XIM
|
#ifdef HAVE_XIM
|
||||||
if (m_ic)
|
if (m_ic)
|
||||||
gdk_ic_destroy (m_ic);
|
gdk_ic_destroy (m_ic);
|
||||||
|
@@ -174,15 +174,8 @@ wxWindowMac::~wxWindowMac()
|
|||||||
gFocusWindow = NULL ;
|
gFocusWindow = NULL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CS: copied from MSW :
|
|
||||||
// VS: destroy children first and _then_ detach *this from its parent.
|
|
||||||
// If we'd do it the other way around, children wouldn't be able
|
|
||||||
// find their parent frame (see above).
|
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
if ( m_parent )
|
|
||||||
m_parent->RemoveChild(this);
|
|
||||||
|
|
||||||
// delete our drop target if we've got one
|
// delete our drop target if we've got one
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
if ( m_dropTarget != NULL )
|
if ( m_dropTarget != NULL )
|
||||||
|
@@ -174,15 +174,8 @@ wxWindowMac::~wxWindowMac()
|
|||||||
gFocusWindow = NULL ;
|
gFocusWindow = NULL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CS: copied from MSW :
|
|
||||||
// VS: destroy children first and _then_ detach *this from its parent.
|
|
||||||
// If we'd do it the other way around, children wouldn't be able
|
|
||||||
// find their parent frame (see above).
|
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
if ( m_parent )
|
|
||||||
m_parent->RemoveChild(this);
|
|
||||||
|
|
||||||
// delete our drop target if we've got one
|
// delete our drop target if we've got one
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
if ( m_dropTarget != NULL )
|
if ( m_dropTarget != NULL )
|
||||||
|
@@ -591,14 +591,8 @@ wxWindowMGL::~wxWindowMGL()
|
|||||||
if ( gs_windowUnderMouse == this )
|
if ( gs_windowUnderMouse == this )
|
||||||
gs_windowUnderMouse = NULL;
|
gs_windowUnderMouse = NULL;
|
||||||
|
|
||||||
// VS: destroy children first and _then_ detach *this from its parent.
|
|
||||||
// If we'd do it the other way around, children wouldn't be able
|
|
||||||
// find their parent frame (see above).
|
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
if ( m_parent )
|
|
||||||
m_parent->RemoveChild(this);
|
|
||||||
|
|
||||||
if ( m_wnd )
|
if ( m_wnd )
|
||||||
MGL_wmDestroyWindow(m_wnd);
|
MGL_wmDestroyWindow(m_wnd);
|
||||||
}
|
}
|
||||||
|
@@ -374,9 +374,6 @@ wxWindow::~wxWindow()
|
|||||||
DetachWidget(wMain);
|
DetachWidget(wMain);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_parent )
|
|
||||||
m_parent->RemoveChild( this );
|
|
||||||
|
|
||||||
// If m_drawingArea, we're a fully-fledged window with drawing area,
|
// If m_drawingArea, we're a fully-fledged window with drawing area,
|
||||||
// scrollbars etc. (what wxCanvas used to be)
|
// scrollbars etc. (what wxCanvas used to be)
|
||||||
if ( m_drawingArea )
|
if ( m_drawingArea )
|
||||||
|
@@ -520,9 +520,6 @@ wxWindowMSW::~wxWindowMSW()
|
|||||||
// find their parent frame (see above).
|
// find their parent frame (see above).
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
if ( m_parent )
|
|
||||||
m_parent->RemoveChild(this);
|
|
||||||
|
|
||||||
if ( m_hWnd )
|
if ( m_hWnd )
|
||||||
{
|
{
|
||||||
// VZ: test temp removed to understand what really happens here
|
// VZ: test temp removed to understand what really happens here
|
||||||
|
@@ -362,9 +362,6 @@ wxWindowOS2::~wxWindowOS2()
|
|||||||
|
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
if (m_parent)
|
|
||||||
m_parent->RemoveChild(this);
|
|
||||||
|
|
||||||
if (m_hWnd)
|
if (m_hWnd)
|
||||||
{
|
{
|
||||||
if(!::WinDestroyWindow(GetHWND()))
|
if(!::WinDestroyWindow(GetHWND()))
|
||||||
|
@@ -348,9 +348,6 @@ wxWindowX11::~wxWindowX11()
|
|||||||
|
|
||||||
m_isBeingDeleted = TRUE;
|
m_isBeingDeleted = TRUE;
|
||||||
|
|
||||||
if (m_parent)
|
|
||||||
m_parent->RemoveChild( this );
|
|
||||||
|
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
if (m_clientWindow != m_mainWindow)
|
if (m_clientWindow != m_mainWindow)
|
||||||
|
Reference in New Issue
Block a user