diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2020-11-30 11:48:38 +0100 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2020-12-02 12:31:40 +0100 |
commit | 776955c7dd7d31a5bc8c3503e867d702132a6d6b (patch) | |
tree | 9139430b5662a0438155ce902ae952877f585730 | |
parent | 0c7757ff6f75505d5abc4baa9522b63d694c92ac (diff) |
Fix property cache leaks
Ported the fix fcae2d13e43eab1ea60092194667939f85269bde to 5.12 branch
Fixes: QTBUG-87228
Change-Id: If7cdf38b0f0641f9d7dca4b4dcbbde3995e05e6e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 9fb91e9140..adef147ccd 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -62,6 +62,7 @@ #include <QStandardPaths> #include <QDir> #include <private/qv4identifiertable_p.h> +#include <private/qqmltypewrapper_p.h> #endif #include <private/qqmlirbuilder_p.h> #include <QCoreApplication> @@ -285,7 +286,8 @@ void CompilationUnit::unlink() if (runtimeLookups) { for (uint i = 0; i < data->lookupTableSize; ++i) { QV4::Lookup &l = runtimeLookups[i]; - if (l.getter == QV4::QObjectWrapper::lookupGetter) { + if (l.getter == QV4::QObjectWrapper::lookupGetter + || l.getter == QQmlTypeWrapper::lookupSingletonProperty) { if (QQmlPropertyCache *pc = l.qobjectLookup.propertyCache) pc->release(); } else if (l.getter == QQmlValueTypeWrapper::lookupGetter) { @@ -293,7 +295,8 @@ void CompilationUnit::unlink() pc->release(); } - if (l.qmlContextPropertyGetter == QQmlContextWrapper::lookupScopeObjectProperty) { + if (l.qmlContextPropertyGetter == QQmlContextWrapper::lookupScopeObjectProperty + || l.qmlContextPropertyGetter == QQmlContextWrapper::lookupContextObjectProperty) { if (QQmlPropertyCache *pc = l.qobjectLookup.propertyCache) pc->release(); } |