X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/163b01c128461268b82035b2c1fd2233b827cce6..ab7049776d45e622f621dd06216a4c1a1ad34b15:/src/common/menucmn.cpp diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 32f525d673..a39ab6852e 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -597,17 +597,10 @@ 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; - } + wxWindow * const win = GetWindow(); - if ( !source && GetInvokingWindow() ) - source = GetInvokingWindow()->GetEventHandler(); + if ( !source && win ) + source = win->GetEventHandler(); if ( !source ) source = GetEventHandler(); if ( !source ) @@ -1045,18 +1038,13 @@ wxString wxMenuBarBase::GetHelpString(int itemid) const void wxMenuBarBase::UpdateMenus() { - wxEvtHandler* source; wxMenu* menu; int nCount = GetMenuCount(); for (int n = 0; n < nCount; n++) { menu = GetMenu( n ); if (menu != NULL) - { - source = menu->GetEventHandler(); - if (source != NULL) - menu->UpdateUI( source ); - } + menu->UpdateUI( NULL ); } }