aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlscriptdata.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-09-30 16:20:19 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-09-30 17:11:52 +0200
commit224f053eba157fb908f08909d8e2015d76b08295 (patch)
tree18c8207e3fe03b9dfa5754736be7d3fc51ece468 /src/qml/qml/qqmlscriptdata.cpp
parentcf51a723ffbddc5338628b99fa4a5b5b4d17295c (diff)
Use a QQmlRefPointer for QQmlScriptData::typeNameCache
The cache can get overwritten. We want the reference to the old one to be dropped then. Fixes: QTBUG-78865 Change-Id: I8ebba4ae242c3bf8ae4db5cffc65b26bab265b8a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlscriptdata.cpp')
-rw-r--r--src/qml/qml/qqmlscriptdata.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlscriptdata.cpp b/src/qml/qml/qqmlscriptdata.cpp
index 0725f40d2a..ae268ca904 100644
--- a/src/qml/qml/qqmlscriptdata.cpp
+++ b/src/qml/qml/qqmlscriptdata.cpp
@@ -156,11 +156,7 @@ QV4::ReturnedValue QQmlScriptData::scriptValueForContext(QQmlContextData *parent
void QQmlScriptData::clear()
{
- if (typeNameCache) {
- typeNameCache->release();
- typeNameCache = nullptr;
- }
-
+ typeNameCache = nullptr;
scripts.clear();
// An addref() was made when the QQmlCleanup was added to the engine.