aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/compiler/qv4compileddata.cpp11
-rw-r--r--src/qml/compiler/qv4compileddata_p.h1
-rw-r--r--src/qml/qml/qqmlcompileddata.cpp8
-rw-r--r--src/qml/qml/qqmlcompiler_p.h3
4 files changed, 12 insertions, 11 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 7a2404f40c..d4ed899d3e 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -222,6 +222,17 @@ void CompilationUnit::markObjects(QV4::ExecutionEngine *e)
}
}
+void CompilationUnit::destroy()
+{
+ QQmlEngine *qmlEngine = 0;
+ if (engine)
+ qmlEngine = engine->qmlEngine();
+ if (qmlEngine)
+ QQmlEnginePrivate::deleteInEngineThread(qmlEngine, this);
+ else
+ delete this;
+}
+
IdentifierHash<int> CompilationUnit::namedObjectsPerComponent(int componentObjectIndex)
{
auto it = namedObjectsPerComponentCache.find(componentObjectIndex);
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index cb4941d147..117bad0c8b 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -734,6 +734,7 @@ struct Q_QML_PRIVATE_EXPORT CompilationUnit : public QQmlRefCount
void markObjects(QV4::ExecutionEngine *e);
+ void destroy() Q_DECL_OVERRIDE;
protected:
virtual void linkBackendToEngine(QV4::ExecutionEngine *engine) = 0;
#endif // V4_BOOTSTRAP
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()
{
}
diff --git a/src/qml/qml/qqmlcompiler_p.h b/src/qml/qml/qqmlcompiler_p.h
index 35beba1562..2846ae4084 100644
--- a/src/qml/qml/qqmlcompiler_p.h
+++ b/src/qml/qml/qqmlcompiler_p.h
@@ -91,9 +91,6 @@ public:
QQmlRefPointer<QV4::CompiledData::CompilationUnit> compilationUnit;
-protected:
- virtual void destroy(); // From QQmlRefCount
-
private:
QQmlCompiledData(const QQmlCompiledData &other);
QQmlCompiledData &operator=(const QQmlCompiledData &other);