diff --git a/src/blackmisc/worker.cpp b/src/blackmisc/worker.cpp index 917cdabbb..a281aec01 100644 --- a/src/blackmisc/worker.cpp +++ b/src/blackmisc/worker.cpp @@ -114,18 +114,19 @@ namespace BlackMisc void CWorkerBase::abandon() noexcept { - thread()->requestInterruption(); + if (thread() != thread()->thread()) { thread()->requestInterruption(); } quit(); } void CWorkerBase::abandonAndWait() noexcept { - thread()->requestInterruption(); + if (thread() != thread()->thread()) { thread()->requestInterruption(); } quitAndWait(); } bool CWorkerBase::isAbandoned() const { + Q_ASSERT(thread() == QThread::currentThread()); return thread()->isInterruptionRequested(); }