From 42f5c0f48497782cb4df5c1bc498426552aed49f Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 14 Sep 2022 13:51:48 +0200 Subject: [PATCH] fix: Tasks being interrupted even if they already finished --- lib/libimhex/source/api/task.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libimhex/source/api/task.cpp b/lib/libimhex/source/api/task.cpp index 21d7c5ae7..c2c32128e 100644 --- a/lib/libimhex/source/api/task.cpp +++ b/lib/libimhex/source/api/task.cpp @@ -48,7 +48,9 @@ namespace hex { } Task::~Task() { - this->interrupt(); + if (!this->isFinished()) + this->interrupt(); + this->m_thread.join(); }