Fix recent regression with destroying wxDataViewCtrl on app exit
As mentioned in the commit message of b628237245 (Fix crash due to using
wxLog during shutdown in a better way, 2024-01-26), this change could
affect existing code using wxTheApp and it did affect wxDataViewCtrl and
not in a good way: destroying it during application shutdown started to
crash now that wxTheApp is null when it happens.
Fix this by skipping the idle time notification when shutting down, it's
not useful anyhow by then.
This commit is contained in:
parent
cfb321b175
commit
6636a2ac9e
1 changed files with 4 additions and 1 deletions
|
|
@ -5605,7 +5605,10 @@ wxDataViewCtrl::~wxDataViewCtrl()
|
|||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
SetAccessible(nullptr);
|
||||
wxAccessible::NotifyEvent(wxACC_EVENT_OBJECT_DESTROY, this, wxOBJID_CLIENT, wxACC_SELF);
|
||||
// There is no need to notify anybody if we're destroyed as part of
|
||||
// application shutdown and doing it would just crash in this case.
|
||||
if ( wxTheApp )
|
||||
wxAccessible::NotifyEvent(wxACC_EVENT_OBJECT_DESTROY, this, wxOBJID_CLIENT, wxACC_SELF);
|
||||
#endif // wxUSE_ACCESSIBILITY
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue