From ea061ae23985334639a4e48d5d0884d36b22fe4a Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Thu, 10 Mar 2022 20:33:22 +0100 Subject: [PATCH] destruct LogThread correctly --- src/libcalamaresui/widgets/LogWidget.cpp | 7 +++++++ src/libcalamaresui/widgets/LogWidget.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/libcalamaresui/widgets/LogWidget.cpp b/src/libcalamaresui/widgets/LogWidget.cpp index a4af6c522..18642f089 100644 --- a/src/libcalamaresui/widgets/LogWidget.cpp +++ b/src/libcalamaresui/widgets/LogWidget.cpp @@ -13,6 +13,13 @@ LogThread::LogThread(QObject *parent) } +LogThread::~LogThread() +{ + quit(); + requestInterruption(); + wait(); +} + void LogThread::run() { auto filePath = Logger::logFile(); diff --git a/src/libcalamaresui/widgets/LogWidget.h b/src/libcalamaresui/widgets/LogWidget.h index 2def81845..c51e64393 100644 --- a/src/libcalamaresui/widgets/LogWidget.h +++ b/src/libcalamaresui/widgets/LogWidget.h @@ -16,6 +16,7 @@ class LogThread : public QThread public: explicit LogThread(QObject *parent = nullptr); + ~LogThread() override; signals: void onLogChunk(const QString &logChunk);