Fix crash when deleting a QMenu on exit
If the application object is an ancestor of QMenu, dereferencing qApp in its destructor will cause a crash. Task-number: QTBUG-30756 Change-Id: I31a33db0fd783bb210a420618911ea8b412e9a0f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
parent
a7ce34dba4
commit
e324f5bc0e
@ -172,7 +172,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
|
||||
parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry()));
|
||||
d->deactivateWidgetCleanup();
|
||||
|
||||
if ((windowType() == Qt::Popup))
|
||||
if ((windowType() == Qt::Popup) && qApp)
|
||||
qApp->d_func()->closePopup(this);
|
||||
|
||||
if (this == QApplicationPrivate::active_window)
|
||||
|
Loading…
Reference in New Issue
Block a user