summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-07-27 08:23:44 (GMT)
committerToby Tomkins <toby.tomkins@nokia.com>2010-07-28 06:15:14 (GMT)
commit3a2a18d64f96f54522869495eba33935374c1f1e (patch)
tree806055c89757428154939bc5551bdb30031721e1 /src/gui/graphicsview
parent1772b199718fd3e113175ffbb5eddfa5fd51656b (diff)
downloadQt-3a2a18d64f96f54522869495eba33935374c1f1e.zip
Qt-3a2a18d64f96f54522869495eba33935374c1f1e.tar.gz
Qt-3a2a18d64f96f54522869495eba33935374c1f1e.tar.bz2
Check the gesturemanager pointer before accessing it.
This fixes a crash when a static QWidget is destroyed after the QApplication object. Task-number: QTBUG-12025 Reviewed-by: Zeno Albisser (cherry picked from commit 475a3c275ba173cb130a838b6053cb45d405887e)
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index cd03eeb..adccd86 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1437,9 +1437,10 @@ QGraphicsItem::~QGraphicsItem()
#ifndef QT_NO_GESTURES
if (d_ptr->isObject && !d_ptr->gestureContext.isEmpty()) {
QGraphicsObject *o = static_cast<QGraphicsObject *>(this);
- QGestureManager *manager = QGestureManager::instance();
- foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
- manager->cleanupCachedGestures(o, type);
+ if (QGestureManager *manager = QGestureManager::instance()) {
+ foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
+ manager->cleanupCachedGestures(o, type);
+ }
}
#endif