~wxToolBar() checks if the frame is being deleted in a better/more clear way

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-09-24 00:16:48 +00:00
parent 24a23c3573
commit c2fd78b10f

View File

@@ -264,11 +264,8 @@ wxToolBar::~wxToolBar()
{ {
// we must refresh the frame size when the toolbar is deleted but the frame // we must refresh the frame size when the toolbar is deleted but the frame
// is not - otherwise toolbar leaves a hole in the place it used to occupy // is not - otherwise toolbar leaves a hole in the place it used to occupy
//
// NB: a frame is being deleted only if it is not any longer in
// wxTopLevelWindows list
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
if ( frame && wxTopLevelWindows.Find(frame) ) if ( frame && !frame->IsBeingDeleted() )
{ {
frame->SendSizeEvent(); frame->SendSizeEvent();
} }