aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlimport.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-09 12:36:29 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-18 14:59:55 +0200
commit34c80149602c1ca52b541cd1adb67b9a1abfd5da (patch)
treea74fe9bb7a84eaaba1ae7036a36b55fcda166b8c /src/qml/qml/qqmlimport.cpp
parentd46c406cc67f12e6a0798ef509abbb973b34d39d (diff)
Lock all type modules of the same URI when importing a plugin
A plugin may provide multiple versions of the same types. If we don't lock them all, a further plugin may later mess with the ones we didn't lock. The code clearly attempts to prevent such a situation. Of course, a plugin may still register types under a wholly different URI, and sidestep this mechanism. However, in contrast to exposing multiple major versions from the same plugin, this is not recommended. Change-Id: Ib8d8bbeec8e738020c6d07aedcc4664157b80dcf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlimport.cpp')
-rw-r--r--src/qml/qml/qqmlimport.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 517bf2908d..b237ba174a 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -2180,7 +2180,7 @@ static bool lockModule(const QString &uri, const QString &typeNamespace, QTypeRe
QList<QQmlError> *errors)
{
if (version.hasMajorVersion() && !typeNamespace.isEmpty()
- && !QQmlMetaType::protectModule(uri, version)) {
+ && !QQmlMetaType::protectModule(uri, version, true)) {
// Not being able to protect the module means there are not types registered for it,
// means the plugin we loaded didn't provide any, means we didn't find the module.
// We output the generic error message as depending on the load order of imports we may