summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Barron <jason.barron@nokia.com>2010-10-07 13:52:27 (GMT)
committerJason Barron <jason.barron@nokia.com>2010-10-07 14:02:15 (GMT)
commit7f875312dcc09a4b2dcc5030e813e921b1dc7ee4 (patch)
treeabc2575737013ed3add439c886be668d34ecabe2 /src
parenta3c755e358596238dc7fc1c284328a6226c2ed3a (diff)
downloadQt-7f875312dcc09a4b2dcc5030e813e921b1dc7ee4.zip
Qt-7f875312dcc09a4b2dcc5030e813e921b1dc7ee4.tar.gz
Qt-7f875312dcc09a4b2dcc5030e813e921b1dc7ee4.tar.bz2
Fix crash when using Q_GLOBAL_STATIC(QWidget...)
If Q_GLOBAL_STATIC is used with a QWidget (or subclass) then the destructor of QWidget will be executed after the destructor of QApplication. Since ~QApplication() destroys the S60 environment and the trap handler, we need to be sure that if QApplication is destroyed, we do not attempt to use anything from the S60 environment. This includes RWsSession and the trap handler. The fix is to avoid flushing the WSERV buffer if QApplication has been deleted already. Reviewed-by: axis
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget_s60.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 49d2ffc..9a451ce 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1252,7 +1252,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
// At this point the backing store should already be destroyed
// so we flush the command buffer to ensure that the freeing of
// those resources and deleting the window can happen "atomically"
- S60->wsSession().Flush();
+ if (qApp)
+ S60->wsSession().Flush();
}
}