summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-04-23 12:01:01 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-23 13:12:33 +0200
commite324f5bc0e6abb8772b29f5016afda0814d8f9cd (patch)
treecc982747e04db9d418807b3fab1080039988d208 /src
parenta7ce34dba4213927deba443e0e9c42df1769cc25 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index fdc72ee23c..a4da98815b 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -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)