From 7b820fcb42e2ac864d7738009a84add7b68022e2 Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Tue, 5 Jan 2021 15:59:22 +0100 Subject: [PATCH] RomSearcherThread: terminate in deconstructor --- Source/RMG/Thread/RomSearcherThread.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/RMG/Thread/RomSearcherThread.cpp b/Source/RMG/Thread/RomSearcherThread.cpp index 6b3802a4..92aba506 100644 --- a/Source/RMG/Thread/RomSearcherThread.cpp +++ b/Source/RMG/Thread/RomSearcherThread.cpp @@ -21,6 +21,12 @@ RomSearcherThread::RomSearcherThread(QObject *parent) : QThread(parent) RomSearcherThread::~RomSearcherThread(void) { + // kill the thread when we're running + if (this->isRunning()) + { + this->terminate(); + this->wait(); + } } void RomSearcherThread::SetDirectory(QString directory)