delete children in ~wxWindow dtor and not in the base class ~wxWindowNative as it's too late there (replaces patch 1082605; closes bug 1068000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -73,6 +73,8 @@ public:
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
virtual ~wxWindow();
|
||||
|
||||
// background pixmap support
|
||||
// -------------------------
|
||||
|
||||
|
@@ -179,6 +179,18 @@ bool wxWindow::Create(wxWindow *parent,
|
||||
return true;
|
||||
}
|
||||
|
||||
wxWindow::~wxWindow()
|
||||
{
|
||||
m_isBeingDeleted = true;
|
||||
|
||||
// we have to destroy our children before we're destroyed because our
|
||||
// children suppose that we're of type wxWindow, not just wxWindowNative,
|
||||
// and so bad things may happen if they're deleted from the base class dtor
|
||||
// as by then we're not a wxWindow any longer and wxUniv-specific virtual
|
||||
// functions can't be called
|
||||
DestroyChildren();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// background pixmap
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user