aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-05-14 18:45:03 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-30 10:38:48 +0200
commit67a101af142355a0ca7cdc234b7ee1716a25d87c (patch)
tree1e0c99bdd9667d24e71075192d8616a3f9c2f4c4 /src/quick
parent9ba195479ac3bc2c64d43ecf26f8c97e65483a5c (diff)
Fix potential null pointer dereferencing
These were found by http://www.viva64.com/en/b/025 most issues are rather cosmetic. Change-Id: I7cc12610aae6a43d26bedb9b480863c0695ddfa3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickmousearea.cpp2
-rw-r--r--src/quick/items/qquickmultipointtoucharea.cpp2
-rw-r--r--src/quick/util/qquickpixmapcache.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index baa48291e2..d4b64ea75a 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -894,7 +894,7 @@ bool QQuickMouseArea::sendMouseEvent(QMouseEvent *event)
default:
break;
}
- grabber = c->mouseGrabberItem();
+ grabber = c ? c->mouseGrabberItem() : 0;
if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this)
grabMouse();
diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp
index c20559454e..ee31c018af 100644
--- a/src/quick/items/qquickmultipointtoucharea.cpp
+++ b/src/quick/items/qquickmultipointtoucharea.cpp
@@ -844,7 +844,7 @@ bool QQuickMultiPointTouchArea::sendMouseEvent(QMouseEvent *event)
default:
break;
}
- grabber = c->mouseGrabberItem();
+ grabber = c ? c->mouseGrabberItem() : 0;
if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this)
grabMouse();
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index a7f9174219..a5a56949e6 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -805,7 +805,7 @@ void QQuickPixmapStore::unreferencePixmap(QQuickPixmapData *data)
if (!m_lastUnreferencedPixmap)
m_lastUnreferencedPixmap = data;
- shrinkCache(-1); // Shrink the cache incase it has become larger than cache_limit
+ shrinkCache(-1); // Shrink the cache in case it has become larger than cache_limit
if (m_timerId == -1 && m_unreferencedPixmaps && !m_destroying)
m_timerId = startTimer(CACHE_EXPIRE_TIME * 1000);