X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/906c935a80b10d53cecf57f71ab5f3f4f1d529ec..77c8efc8c37da6d6a5e2e8022d21d1cd7d76371d:/src/common/menucmn.cpp diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index d53056d9ee..f34a5bf0f6 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(); @@ -622,7 +614,7 @@ void wxMenuBase::UpdateUI(wxEvtHandler* source) { wxWindowID itemid = item->GetId(); wxUpdateUIEvent event(itemid); - event.SetEventObject( source ); + event.SetEventObject( this ); if ( source->ProcessEvent(event) ) { @@ -1046,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 ); } }