diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-01-26 17:21:59 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2015-01-26 17:29:18 +0100 |
commit | 18ef8a2d82fd898be83bf2bc9a6f946d879ac14e (patch) | |
tree | f6b0c535a9838b10a517249632c67af5df73bbad | |
parent | 8dc50118a0ece90a997aaa93cd834dbd75f90639 (diff) |
Do not insert into module property cache if caching is disabled.
The current code does not seem to result in observable issues, but it
can't possibly be right to retrieve a value from the cache that was
inserted while caching was off.
Change-Id: I6db84652014b155f93056e48d52915c846892560
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rw-r--r-- | src/lib/corelib/jsextensions/moduleproperties.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/corelib/jsextensions/moduleproperties.cpp b/src/lib/corelib/jsextensions/moduleproperties.cpp index bed72ee55..5780ad401 100644 --- a/src/lib/corelib/jsextensions/moduleproperties.cpp +++ b/src/lib/corelib/jsextensions/moduleproperties.cpp @@ -142,7 +142,8 @@ QScriptValue ModuleProperties::moduleProperties(QScriptContext *context, QScript // Cache the variant value. We must not cache the QScriptValue here, because it's a // reference and the user might change the actual object. - qbsEngine->addToPropertyCache(moduleName, propertyName, oneValue, properties, value); + if (qbsEngine->isPropertyCacheEnabled()) + qbsEngine->addToPropertyCache(moduleName, propertyName, oneValue, properties, value); } return engine->toScriptValue(value); } |