diff options
-rw-r--r-- | src/qml/qml/qqmlscriptdata.cpp | 14 | ||||
-rw-r--r-- | src/qml/qml/qqmlscriptdata_p.h | 13 |
2 files changed, 1 insertions, 26 deletions
diff --git a/src/qml/qml/qqmlscriptdata.cpp b/src/qml/qml/qqmlscriptdata.cpp index 50ec0e20cd..684564fcfb 100644 --- a/src/qml/qml/qqmlscriptdata.cpp +++ b/src/qml/qml/qqmlscriptdata.cpp @@ -117,11 +117,6 @@ QV4::ReturnedValue QQmlScriptData::scriptValueForContext( QV4::ExecutionEngine *v4 = parentQmlContextData->engine()->handle(); QV4::Scope scope(v4); - if (!hasEngine()) { - addToEngine(parentQmlContextData->engine()); - addref(); - } - QV4::Scoped<QV4::QmlContext> qmlExecutionContext(scope); if (auto qmlContextData = qmlContextDataForContext(parentQmlContextData)) { qmlExecutionContext = QV4::QmlContext::create(v4->rootContext(), std::move(qmlContextData), @@ -158,13 +153,4 @@ QV4::ReturnedValue QQmlScriptData::scriptValueForContext( return value->asReturnedValue(); } -void QQmlScriptData::clear() -{ - typeNameCache = nullptr; - scripts.clear(); - - // An addref() was made when the QQmlCleanup was added to the engine. - release(); -} - QT_END_NAMESPACE diff --git a/src/qml/qml/qqmlscriptdata_p.h b/src/qml/qml/qqmlscriptdata_p.h index abbafc33c2..38b80e1bfa 100644 --- a/src/qml/qml/qqmlscriptdata_p.h +++ b/src/qml/qml/qqmlscriptdata_p.h @@ -65,14 +65,7 @@ QT_BEGIN_NAMESPACE class QQmlTypeNameCache; class QQmlContextData; -// QQmlScriptData instances are created, uninitialized, by the loader in the -// load thread. The first time they are used by the VME, they are initialized which -// creates their v8 objects and they are referenced and added to the engine's cleanup -// list. During QQmlCleanup::clear() all v8 resources are destroyed, and the -// reference that was created is released but final deletion only occurs once all the -// references as released. This is all intended to ensure that the v8 resources are -// only created and destroyed in the main thread :) -class Q_AUTOTEST_EXPORT QQmlScriptData : public QQmlCleanup, public QQmlRefCount +class Q_AUTOTEST_EXPORT QQmlScriptData : public QQmlRefCount { private: friend class QQmlTypeLoader; @@ -89,13 +82,9 @@ public: QQmlRefPointer<QV4::ExecutableCompilationUnit> compilationUnit() const { return m_precompiledScript; } -protected: - void clear() override; // From QQmlCleanup - private: friend class QQmlScriptBlob; - void initialize(QQmlEngine *); QQmlRefPointer<QQmlContextData> qmlContextDataForContext( const QQmlRefPointer<QQmlContextData> &parentQmlContextData); |