From 736b8205158dd7b98af862a029b273dff6fb716d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 8 Dec 2010 13:23:23 +0100 Subject: QApplication: fix crash exit whith native windows Regression introduced in 8dd8db250d92521fda619bdcf3e1c859b37b2da0 Patch comes from the task Task-number: QTBUG-15774 --- src/gui/kernel/qapplication.cpp | 6 +++--- tests/auto/qapplication/modal/main.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index a4ae46b..b4ff7c4 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -1101,6 +1101,9 @@ QApplication::~QApplication() QApplicationPrivate::is_app_closing = true; QApplicationPrivate::is_app_running = false; + delete QWidgetPrivate::mapper; + QWidgetPrivate::mapper = 0; + // delete all widgets if (QWidgetPrivate::allWidgets) { QWidgetSet *mySet = QWidgetPrivate::allWidgets; @@ -1130,9 +1133,6 @@ QApplication::~QApplication() delete d->ignore_cursor; d->ignore_cursor = 0; #endif - delete QWidgetPrivate::mapper; - QWidgetPrivate::mapper = 0; - delete QApplicationPrivate::app_pal; QApplicationPrivate::app_pal = 0; delete QApplicationPrivate::sys_pal; diff --git a/tests/auto/qapplication/modal/main.cpp b/tests/auto/qapplication/modal/main.cpp index f9d8fb4..3eaaa0d 100644 --- a/tests/auto/qapplication/modal/main.cpp +++ b/tests/auto/qapplication/modal/main.cpp @@ -47,6 +47,7 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); + QApplication::setAttribute(Qt::AA_NativeWindows); //QTBUG-15774 base *b = new base(); return app.exec(); } -- cgit v0.12