From 24ebaded86f49c669341176a4d9b1c5fb0559588 Mon Sep 17 00:00:00 2001 From: Silke Schomann Date: Mon, 7 Oct 2024 15:31:42 +0100 Subject: [PATCH] Wait for result before destructing interface --- qt/widgets/common/src/BatchAlgorithmRunner.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qt/widgets/common/src/BatchAlgorithmRunner.cpp b/qt/widgets/common/src/BatchAlgorithmRunner.cpp index 07e64520787c..262ddb173cf0 100644 --- a/qt/widgets/common/src/BatchAlgorithmRunner.cpp +++ b/qt/widgets/common/src/BatchAlgorithmRunner.cpp @@ -55,7 +55,9 @@ BatchAlgorithmRunner::BatchAlgorithmRunner(QObject *parent) m_executeAsync(this, &BatchAlgorithmRunner::executeBatchAsyncImpl) {} BatchAlgorithmRunner::~BatchAlgorithmRunner() { - cancelBatch(); + Poco::ActiveResult result = m_executeAsync(Poco::Void()); + result.wait(); + removeAllObservers(); }