From be6d1499af75228341227d15441284e07cfe1e41 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 21 Dec 2023 16:53:36 +0100 Subject: QtQml: Always link executable CU on creation We don't want floating unlinked executable CUs. They should always be tied to an engine, and the engine should not change. This gives us one definite point where to register them with the engine (to be done in subsequent change). Unfortunately, due to the refcounting, we need to remove the engine from any still-referenced CUs when the engine itself is destructed. We will be able to drop the refcounting and make the engine fully own its executable CUs once we can hold base CUs in most places. Change-Id: I9a53e83d5c4746c2b2bca896b51baa4fe7fee757 Reviewed-by: Fabian Kosmale --- src/qmlworkerscript/qquickworkerscript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qmlworkerscript/qquickworkerscript.cpp') diff --git a/src/qmlworkerscript/qquickworkerscript.cpp b/src/qmlworkerscript/qquickworkerscript.cpp index f57d39b0c7..6f09d4357d 100644 --- a/src/qmlworkerscript/qquickworkerscript.cpp +++ b/src/qmlworkerscript/qquickworkerscript.cpp @@ -255,7 +255,7 @@ void QQuickWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url) if (fileName.endsWith(QLatin1String(".mjs"))) { auto module = engine->loadModule(url); if (module.compiled) { - if (module.compiled->instantiate(engine)) + if (module.compiled->instantiate()) module.compiled->evaluate(); } else if (module.native) { // Nothing to do. There is no global code in a native module. -- cgit v1.2.3