X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae29146343c4c84d80ff907c352e94740d076a3d..20fa338c4120e89356d31e46e9f8c97e0bca67c7:/src/common/tbarbase.cpp?ds=sidebyside diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index f2310dc1a9..d2243fedf2 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -621,6 +621,12 @@ 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 + wxWindow *tlw = wxGetTopLevelParent( this ); + if (tlw && wxPendingDelete.Member( tlw )) + return; + wxEvtHandler* evtHandler = GetEventHandler() ; for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();