From b86ca0947bf52687adba8bbfccf5c412a3a32199 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 20 Nov 2023 18:27:28 +0100 Subject: [PATCH] QmlPreview: Fix double deletion of RefreshTranslationWorker The RunControl takes ownership of its RunWorkers. Change-Id: I720d4404f991651de5d5f7906fbea96f0e4e20ba Reviewed-by: Tim Jenssen Reviewed-by: --- src/plugins/qmlpreview/qmlpreviewruncontrol.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp index 5bdb2e78a08..cdd6388997d 100644 --- a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp +++ b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp @@ -84,11 +84,10 @@ private: void stop() override; QmlPreviewConnectionManager m_connectionManager; - RefreshTranslationWorker m_refreshTranslationWorker; }; QmlPreviewRunner::QmlPreviewRunner(RunControl *runControl, const QmlPreviewRunnerSetting &settings) - : RunWorker(runControl), m_refreshTranslationWorker(runControl, settings) + : RunWorker(runControl) { setId("QmlPreviewRunner"); m_connectionManager.setFileLoader(settings.fileLoader); @@ -134,7 +133,7 @@ QmlPreviewRunner::QmlPreviewRunner(RunControl *runControl, const QmlPreviewRunne runControl->initiateStop(); }); - addStartDependency(&m_refreshTranslationWorker); + addStartDependency(new RefreshTranslationWorker(runControl, settings)); } void QmlPreviewRunner::start()