Fixes for segfaults when the parent frame is destroyed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -82,8 +82,9 @@ wxAuiMDIParentFrame::~wxAuiMDIParentFrame()
|
|||||||
wxDELETE(m_pClientWindow);
|
wxDELETE(m_pClientWindow);
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
|
wxDELETE(m_pMyMenuBar);
|
||||||
RemoveWindowMenu(GetMenuBar());
|
RemoveWindowMenu(GetMenuBar());
|
||||||
delete m_pWindowMenu;
|
wxDELETE(m_pWindowMenu);
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +167,7 @@ void wxAuiMDIParentFrame::SetMenuBar(wxMenuBar* pMenuBar)
|
|||||||
AddWindowMenu(pMenuBar);
|
AddWindowMenu(pMenuBar);
|
||||||
|
|
||||||
wxFrame::SetMenuBar(pMenuBar);
|
wxFrame::SetMenuBar(pMenuBar);
|
||||||
m_pMyMenuBar = GetMenuBar();
|
//m_pMyMenuBar = GetMenuBar();
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
@@ -179,7 +180,7 @@ void wxAuiMDIParentFrame::SetChildMenuBar(wxAuiMDIChildFrame* pChild)
|
|||||||
SetMenuBar(m_pMyMenuBar);
|
SetMenuBar(m_pMyMenuBar);
|
||||||
|
|
||||||
// Make sure we know our menu bar is in use
|
// Make sure we know our menu bar is in use
|
||||||
//m_pMyMenuBar = NULL;
|
m_pMyMenuBar = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -416,6 +417,13 @@ wxAuiMDIChildFrame::wxAuiMDIChildFrame(wxAuiMDIParentFrame *parent,
|
|||||||
|
|
||||||
wxAuiMDIChildFrame::~wxAuiMDIChildFrame()
|
wxAuiMDIChildFrame::~wxAuiMDIChildFrame()
|
||||||
{
|
{
|
||||||
|
wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame();
|
||||||
|
if (pParentFrame && pParentFrame->GetActiveChild() == this)
|
||||||
|
{
|
||||||
|
pParentFrame->SetActiveChild(NULL);
|
||||||
|
pParentFrame->SetChildMenuBar(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
#if wxUSE_MENUS
|
#if wxUSE_MENUS
|
||||||
wxDELETE(m_pMenuBar);
|
wxDELETE(m_pMenuBar);
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
Reference in New Issue
Block a user