Skip to content
Snippets Groups Projects
Commit bfd7fd46 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Synchronize Engine::registerValue.

When multiple threads share the Bind instance in a Document and do
lookup on the objects contained inside, that may trigger a new object
creation in some situations - which needs to be synchronized.
parent 58730837
No related branches found
No related tags found
No related merge requests found
...@@ -2528,6 +2528,7 @@ const ObjectValue *Engine::qtObject() const ...@@ -2528,6 +2528,7 @@ const ObjectValue *Engine::qtObject() const
void Engine::registerValue(Value *value) void Engine::registerValue(Value *value)
{ {
QMutexLocker locker(&_mutex);
_registeredValues.append(value); _registeredValues.append(value);
} }
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <QtCore/QString> #include <QtCore/QString>
#include <QtCore/QHash> #include <QtCore/QHash>
#include <QtCore/QSet> #include <QtCore/QSet>
#include <QtCore/QMutex>
namespace QmlJS { namespace QmlJS {
...@@ -735,6 +736,8 @@ private: ...@@ -735,6 +736,8 @@ private:
TypeId _typeId; TypeId _typeId;
CppQmlTypes _cppQmlTypes; CppQmlTypes _cppQmlTypes;
QMutex _mutex;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment