X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/163b01c128461268b82035b2c1fd2233b827cce6..7198c3368055d88249a338eb33b21f051f674806:/src/common/menucmn.cpp 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 )