From 455f5d9d7850a070663c0f3d1a419988cc4b3e3a Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 23 Jul 2010 12:45:14 +1000 Subject: Fix crash in MouseArea Task-number: Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativemousearea.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 40c621a..dcdb9f6 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -521,7 +521,8 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) // If we don't accept hover, we need to reset containsMouse. if (!acceptHoverEvents()) setHovered(false); - if (scene()->mouseGrabberItem() == this) + QGraphicsScene *s = scene(); + if (s && s->mouseGrabberItem() == this) ungrabMouse(); setKeepMouseGrab(false); } -- cgit v0.12