diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index f2310dc1a9..d78bcf6fe8 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -621,6 +621,11 @@ void wxToolBarBase::UpdateWindowUI(long flags) { wxWindowBase::UpdateWindowUI(flags); + // There is no sense in updating the toolbar UI + // if the parent window is about to get destroyed + if (GetParent() && wxPendingDelete.Member( GetParent() )) + return; + wxEvtHandler* evtHandler = GetEventHandler() ; for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();