reset m_frameTool/StatusBar pointers before deleting them (bug 773474)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -233,12 +233,12 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
|||||||
|
|
||||||
wxMDIParentFrame::~wxMDIParentFrame()
|
wxMDIParentFrame::~wxMDIParentFrame()
|
||||||
{
|
{
|
||||||
DestroyChildren();
|
// see comment in ~wxMDIChildFrame
|
||||||
|
|
||||||
// already delete by DestroyChildren()
|
|
||||||
m_frameToolBar = NULL;
|
m_frameToolBar = NULL;
|
||||||
m_frameStatusBar = NULL;
|
m_frameStatusBar = NULL;
|
||||||
|
|
||||||
|
DestroyChildren();
|
||||||
|
|
||||||
if (m_windowMenu)
|
if (m_windowMenu)
|
||||||
{
|
{
|
||||||
delete m_windowMenu;
|
delete m_windowMenu;
|
||||||
@@ -730,12 +730,13 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
|||||||
|
|
||||||
wxMDIChildFrame::~wxMDIChildFrame()
|
wxMDIChildFrame::~wxMDIChildFrame()
|
||||||
{
|
{
|
||||||
DestroyChildren();
|
// will be destroyed by DestroyChildren() but reset them before calling it
|
||||||
|
// to avoid using dangling pointers if a callback comes in the meanwhile
|
||||||
// already deleted by DestroyChildren()
|
|
||||||
m_frameToolBar = NULL;
|
m_frameToolBar = NULL;
|
||||||
m_frameStatusBar = NULL;
|
m_frameStatusBar = NULL;
|
||||||
|
|
||||||
|
DestroyChildren();
|
||||||
|
|
||||||
RemoveWindowMenu(NULL, m_hMenu);
|
RemoveWindowMenu(NULL, m_hMenu);
|
||||||
|
|
||||||
MSWDestroyWindow();
|
MSWDestroyWindow();
|
||||||
|
Reference in New Issue
Block a user