git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40121
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
p.frame->Destroy();
p.frame = NULL;
}
+
+ // make sure there are no references to this pane in our uiparts,
+ // just in case the caller doesn't call Update() immediately after
+ // the DetachPane() call. This prevets obscure crashes which would
+ // happen at window repaint if the caller forgets to call Update()
+ int pi, part_count;
+ for (pi = 0, part_count = (int)m_uiparts.GetCount(); pi < part_count; ++pi)
+ {
+ wxDockUIPart& part = m_uiparts.Item(pi);
+ if (part.pane == &p)
+ {
+ m_uiparts.RemoveAt(pi);
+ part_count--;
+ pi--;
+ continue;
+ }
+ }
+
m_panes.RemoveAt(i);
return true;
}