diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-06-01 10:55:45 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-06-01 10:35:21 +0000 |
commit | 3b14f29b8e5b889c7682eaca3e750493a05bcdb8 (patch) | |
tree | 85af2a2714412cf3db4c8b6e65ccce9ad1300d2f /src/qml/qml/qqmlcompileddata.cpp | |
parent | 1823c1c6d75261cf0b3f247e07ac3d0c7b31f1c0 (diff) |
Ensure that CompilationUnit instances are deleted in the engine thread
When using CompilationUnit with a QML engine, ensure that they are deleted in
the same thread as the QML engine.
Only the QML engine has a secondary thread (not a plain QJSEngine) and there it
may happen that the last refcount drops within the loader thread. For example
when the trimCache() is called within the loader. The destruction of the
CompilationUnit however is not safe to perform in a secondary thread.
Change-Id: Ia0105a8885ec97b0b2159e32e637adbd4e99f016
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlcompileddata.cpp')
-rw-r--r-- | src/qml/qml/qqmlcompileddata.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlcompileddata.cpp b/src/qml/qml/qqmlcompileddata.cpp index 5344c738d8..1a9919c1be 100644 --- a/src/qml/qml/qqmlcompileddata.cpp +++ b/src/qml/qml/qqmlcompileddata.cpp @@ -60,14 +60,6 @@ QQmlCompiledData::QQmlCompiledData(QQmlEngine *engine) Q_ASSERT(engine); } -void QQmlCompiledData::destroy() -{ - if (engine && compilationUnit && compilationUnit->engine) - QQmlEnginePrivate::deleteInEngineThread(engine, this); - else - delete this; -} - QQmlCompiledData::~QQmlCompiledData() { } |