check if pane still exists before closing

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Benjamin Williams
2007-10-16 16:33:30 +00:00
parent ab5146089b
commit 7da1b21e25

View File

@@ -1093,8 +1093,7 @@ bool wxAuiManager::DetachPane(wxWindow* window)
return false; return false;
} }
// ClosePane() destroys or hides the pane depending on its // ClosePane() destroys or hides the pane depending on its flags
// flags
void wxAuiManager::ClosePane(wxAuiPaneInfo& pane_info) void wxAuiManager::ClosePane(wxAuiPaneInfo& pane_info)
{ {
// if we were maximized, restore // if we were maximized, restore
@@ -3531,9 +3530,17 @@ void wxAuiManager::OnFloatingPaneClosed(wxWindow* wnd, wxCloseEvent& evt)
return; return;
} }
else else
{
// close the pane, but check that it
// still exists in our pane array first
// (the event handler above might have removed it)
wxAuiPaneInfo& check = GetPane(wnd);
if (check.IsOk())
{ {
ClosePane(pane); ClosePane(pane);
} }
}
} }
@@ -4342,8 +4349,17 @@ void wxAuiManager::OnPaneButton(wxAuiManagerEvent& evt)
ProcessMgrEvent(e); ProcessMgrEvent(e);
if (!e.GetVeto()) if (!e.GetVeto())
{
// close the pane, but check that it
// still exists in our pane array first
// (the event handler above might have removed it)
wxAuiPaneInfo& check = GetPane(pane.window);
if (check.IsOk())
{ {
ClosePane(pane); ClosePane(pane);
}
Update(); Update();
} }
} }