diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-10-12 10:25:36 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-10-12 10:27:40 (GMT) |
commit | 50ff2f4dbe0a5af6c7bf18c72dd7cf49eb39ee32 (patch) | |
tree | 3ede03c5726e86ee2a5a38b9cdd479ce17730b57 /src/gui/kernel | |
parent | 8df79a473e1a7e5c79b9b10827985bf3e9501002 (diff) | |
download | Qt-50ff2f4dbe0a5af6c7bf18c72dd7cf49eb39ee32.zip Qt-50ff2f4dbe0a5af6c7bf18c72dd7cf49eb39ee32.tar.gz Qt-50ff2f4dbe0a5af6c7bf18c72dd7cf49eb39ee32.tar.bz2 |
Fix for qapplication::testDeleteLaterProcessEvents autotest in Symbian.
Deleting qt_desktopWidget eventually ends up to QSymbianControl
destructor. Calling setFocusSafely from QSymbianControl destructor
causes a new events to be posted to event queue. Posting events tries
to wakeup event dispatcher, which was deleted in QApplication
destructor before calling delete for qt_desktopWidget. This makes
application to panic.
The fix is to change is_app_closing and is_app_running flags to correct
state immediately after event dispatcher is closed down, and check the
is_app_closing flag in QSymbianControl destructor.
The change fixes panic in qapplication::testDeleteLaterProcessEvents,
and otherwise QApplication and QWidget autotest results are same as
before change.
Reviewed-by: Miikka Heikkinen
Reviewed-by: Brad
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index afc6f63..bfccd41 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -943,7 +943,7 @@ void QApplicationPrivate::initialize() graphics_system = QGraphicsSystemFactory::create(graphics_system_name); #endif #ifndef QT_NO_WHEELEVENT -#ifdef Q_OS_MAC +#ifdef Q_OS_MAC QApplicationPrivate::wheel_scroll_lines = 1; #else QApplicationPrivate::wheel_scroll_lines = 3; @@ -1034,11 +1034,11 @@ QApplication::~QApplication() d->eventDispatcher->closingDown(); d->eventDispatcher = 0; + QApplicationPrivate::is_app_closing = true; + QApplicationPrivate::is_app_running = false; delete qt_desktopWidget; qt_desktopWidget = 0; - QApplicationPrivate::is_app_closing = true; - QApplicationPrivate::is_app_running = false; #ifndef QT_NO_CLIPBOARD delete qt_clipboard; diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index acd1041..6919292 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -352,7 +352,8 @@ QSymbianControl::~QSymbianControl() { if (S60->curWin == this) S60->curWin = 0; - setFocusSafely(false); + if (!QApplicationPrivate::is_app_closing) + setFocusSafely(false); S60->appUi()->RemoveFromStack(this); delete m_longTapDetector; } |