X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e0dd12db9955e1e173064bde29943f171c53698f..9c592b6165744aef303720e21b709dd88ab3aa37:/src/common/menucmn.cpp?ds=inline diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 3b2c9d37aa..62118b53b5 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -537,6 +537,15 @@ wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const // window will be used. void wxMenuBase::UpdateUI(wxEvtHandler* source) { + if (GetInvokingWindow()) + { + // Don't update menus if the parent + // frame is about to get deleted + wxWindow *tlw = wxGetTopLevelParent( GetInvokingWindow() ); + if (tlw && wxPendingDelete.Member(tlw)) + return; + } + if ( !source && GetInvokingWindow() ) source = GetInvokingWindow()->GetEventHandler(); if ( !source )