From 3b14f29b8e5b889c7682eaca3e750493a05bcdb8 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 1 Jun 2016 10:55:45 +0200 Subject: 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 --- src/qml/qml/qqmlcompileddata.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/qml/qml/qqmlcompileddata.cpp') 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() { } -- cgit v1.2.3