diff options
author | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-08-18 15:59:04 (GMT) |
---|---|---|
committer | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-08-18 16:04:01 (GMT) |
commit | 8dd8db250d92521fda619bdcf3e1c859b37b2da0 (patch) | |
tree | a020322262504fe0cbc3bcd6f7c620bc41caea3f /src | |
parent | 8e7fb343372acd0bc5fe04db7a5c5542541d4538 (diff) | |
download | Qt-8dd8db250d92521fda619bdcf3e1c859b37b2da0.zip Qt-8dd8db250d92521fda619bdcf3e1c859b37b2da0.tar.gz Qt-8dd8db250d92521fda619bdcf3e1c859b37b2da0.tar.bz2 |
Crash in QWidgetPrivate::init on QApplication::quit() using a modal dialog on Mac
The problem was the order of deletion in the destructor. To autotest
this I create an application, start a modal dialog and then quit the
application.
The fix was contributed by a customer.
Task-number: QTBUG-12673
Reviewed-by: Olivier Goffart
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index e164baf..3d3a749 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -1055,6 +1055,18 @@ QApplication::~QApplication() QApplicationPrivate::is_app_closing = true; QApplicationPrivate::is_app_running = false; + // delete all widgets + if (QWidgetPrivate::allWidgets) { + QWidgetSet *mySet = QWidgetPrivate::allWidgets; + QWidgetPrivate::allWidgets = 0; + for (QWidgetSet::ConstIterator it = mySet->constBegin(); it != mySet->constEnd(); ++it) { + register QWidget *w = *it; + if (!w->parent()) // window + w->destroy(true, true); + } + delete mySet; + } + delete qt_desktopWidget; qt_desktopWidget = 0; @@ -1075,18 +1087,6 @@ QApplication::~QApplication() delete QWidgetPrivate::mapper; QWidgetPrivate::mapper = 0; - // delete all widgets - if (QWidgetPrivate::allWidgets) { - QWidgetSet *mySet = QWidgetPrivate::allWidgets; - QWidgetPrivate::allWidgets = 0; - for (QWidgetSet::ConstIterator it = mySet->constBegin(); it != mySet->constEnd(); ++it) { - register QWidget *w = *it; - if (!w->parent()) // window - w->destroy(true, true); - } - delete mySet; - } - delete QApplicationPrivate::app_pal; QApplicationPrivate::app_pal = 0; delete QApplicationPrivate::sys_pal; |