summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-05-05 09:58:33 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-05-05 13:28:25 (GMT)
commitd43037d3cc7f273a7d23ac1162a7498a4230c359 (patch)
tree12577bc6c7528416c2a30ac70991ad47739eecfc /src/gui/graphicsview/qgraphicsitem.cpp
parent93415af11aeb879e68c46b9c4a470bbb898a4c59 (diff)
downloadQt-d43037d3cc7f273a7d23ac1162a7498a4230c359.zip
Qt-d43037d3cc7f273a7d23ac1162a7498a4230c359.tar.gz
Qt-d43037d3cc7f273a7d23ac1162a7498a4230c359.tar.bz2
Fixes a crash when unregistering a recognizer.
Another fix for the same problem - we also need to be careful - when ungrabbing a gesture for the recognizer that has already been destroyed and cleaning up the QGesture object for it we need to make sure we know it is removed from the obsolete gestures list so that we won't delete it again in the QGestureManager detructor. Task-number: QTBUG-9801 Reviewed-by: Thomas Zander
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 326f130..7fcf4d2 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1423,6 +1423,13 @@ QGraphicsItem::~QGraphicsItem()
d_ptr->inDestructor = 1;
d_ptr->removeExtraItemCache();
+ 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);
+ }
+
clearFocus();
// Update focus scope item ptr.