From 85bf1c438b36d91a77e3371d8fe2d8c3750c4858 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 30 Sep 2019 18:06:57 +0200 Subject: WorkerScript: Directly delete QQuickWorkerScriptEnginePrivate QQuickWorkerScriptEnginePrivate lives in the worker thread. Therefore, once the thread has finished there is no way to send it a deferred delete event. The object and all its children would always leak. As there is no event loop running in the worker thread anymore and this is the dtor of QQuickWorkerScript, it's safe to assume that no one can access the private object anymore afterwards. Change-Id: I51f583ea47060d967403639196247882ff7d2905 Reviewed-by: Simon Hausmann --- 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 b93e297b61..8b236697b9 100644 --- a/src/qmlworkerscript/qquickworkerscript.cpp +++ b/src/qmlworkerscript/qquickworkerscript.cpp @@ -374,7 +374,7 @@ QQuickWorkerScriptEngine::~QQuickWorkerScriptEngine() yieldCurrentThread(); } - d->deleteLater(); + delete d; } WorkerScript::WorkerScript(int id, QQuickWorkerScriptEnginePrivate *parent) -- cgit v1.2.1