diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 6eb1fc78d4..1a280042f1 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -349,7 +349,10 @@ bool wxAppBase::ProcessIdle() while (node) { wxWindow* win = node->GetData(); - if (win->SendIdleEvents(event)) + + // Don't send idle events to the windows that are about to be destroyed + // anyhow, this is wasteful and unexpected. + if ( !wxPendingDelete.Member(win) && win->SendIdleEvents(event) ) needMore = true; node = node->GetNext(); } diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index d53056d9ee..9f7d8128c5 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -598,14 +598,6 @@ wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const void wxMenuBase::UpdateUI(wxEvtHandler* source) { wxWindow * const win = GetWindow(); - if ( win ) - { - // Don't update menus if the parent - // frame is about to get deleted - wxWindow *tlw = wxGetTopLevelParent(win); - if (tlw && wxPendingDelete.Member(tlw)) - return; - } if ( !source && win ) source = win->GetEventHandler(); diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index ced3746df2..2a33c1979b 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -701,12 +701,6 @@ void wxToolBarBase::UpdateWindowUI(long flags) if ( !IsShown() ) return; - // There is no sense in updating the toolbar UI - // if the parent window is about to get destroyed - wxWindow *tlw = wxGetTopLevelParent( this ); - if (tlw && wxPendingDelete.Member( tlw )) - return; - wxEvtHandler* evtHandler = GetEventHandler() ; for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();