Don't do toolbar and menu UI updates if
the owning frame or TLW is about to get deleted anyway. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -537,6 +537,15 @@ wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const
|
|||||||
// window will be used.
|
// window will be used.
|
||||||
void wxMenuBase::UpdateUI(wxEvtHandler* source)
|
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() )
|
if ( !source && GetInvokingWindow() )
|
||||||
source = GetInvokingWindow()->GetEventHandler();
|
source = GetInvokingWindow()->GetEventHandler();
|
||||||
if ( !source )
|
if ( !source )
|
||||||
|
@@ -623,7 +623,8 @@ void wxToolBarBase::UpdateWindowUI(long flags)
|
|||||||
|
|
||||||
// There is no sense in updating the toolbar UI
|
// There is no sense in updating the toolbar UI
|
||||||
// if the parent window is about to get destroyed
|
// if the parent window is about to get destroyed
|
||||||
if (GetParent() && wxPendingDelete.Member( GetParent() ))
|
wxWindow *tlw = wxGetTopLevelParent( this );
|
||||||
|
if (tlw && wxPendingDelete.Member( tlw ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxEvtHandler* evtHandler = GetEventHandler() ;
|
wxEvtHandler* evtHandler = GetEventHandler() ;
|
||||||
|
Reference in New Issue
Block a user