X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/163b01c128461268b82035b2c1fd2233b827cce6..08670ea85abf4b4946a9ce64971b591d7b1ee30b:/src/common/menucmn.cpp?ds=inline diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 32f525d673..d53056d9ee 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -597,17 +597,18 @@ wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const // window will be used. void wxMenuBase::UpdateUI(wxEvtHandler* source) { - if (GetInvokingWindow()) + wxWindow * const win = GetWindow(); + if ( win ) { // Don't update menus if the parent // frame is about to get deleted - wxWindow *tlw = wxGetTopLevelParent( GetInvokingWindow() ); + wxWindow *tlw = wxGetTopLevelParent(win); if (tlw && wxPendingDelete.Member(tlw)) return; } - if ( !source && GetInvokingWindow() ) - source = GetInvokingWindow()->GetEventHandler(); + if ( !source && win ) + source = win->GetEventHandler(); if ( !source ) source = GetEventHandler(); if ( !source )