aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2019-12-03 16:23:24 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2019-12-05 11:23:52 +0100
commit290251541e615358dcc7a289ff2adb30f309c132 (patch)
tree4ce2d7839a7633839d93c43ba7b8ca5b2d7c47d9 /tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
parent75c7f093e0b8e321306ae1189b71866a9073df00 (diff)
QQuickPixmapCache: Don't dereference nullptrv5.14.0-rc2v5.14.0
Consistently check that job->data is not null before derefencing it. Fixes: QTBUG-80510 Fixes: QTBUG-79937 Change-Id: I894503ddd2254814463073cc12f8365641efc689 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp')
-rw-r--r--tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
index bffaaf7c6e..1e2e0a6078 100644
--- a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
+++ b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
@@ -30,6 +30,7 @@
#include <QtQuick/private/qquickpixmapcache_p.h>
#include <QtQml/qqmlengine.h>
#include <QtQuick/qquickimageprovider.h>
+#include <QtQml/QQmlComponent>
#include <QNetworkReply>
#include "../../shared/util.h"
#include "testhttpserver.h"
@@ -62,6 +63,7 @@ private slots:
#endif
void lockingCrash();
void uncached();
+ void asynchronousNoCache();
#if PIXMAP_DATA_LEAK_TEST
void dataLeak();
#endif
@@ -473,6 +475,13 @@ void tst_qquickpixmapcache::uncached()
}
}
+void tst_qquickpixmapcache::asynchronousNoCache()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("asynchronousNoCache.qml"));
+ QScopedPointer<QObject> root {component.create()}; // should not crash
+}
+
#if PIXMAP_DATA_LEAK_TEST
// This test should not be enabled by default as it