From 00aef8c8fdec7de8a5df377f2237713aa4774770 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Mon, 30 Sep 2024 12:09:29 +0100 Subject: [PATCH] Use signal/slot do delete queue --- wfmain.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 36429315..2d7325bb 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -148,6 +148,8 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode connect(queue,SIGNAL(sendValue(cacheItem)),this,SLOT(receiveValue(cacheItem))); connect(queue,SIGNAL(sendMessage(QString)),this,SLOT(showStatusBarText(QString))); + connect(queue, SIGNAL(finished()), queue, SLOT(deleteLater())); + // We need to populate the list of rigs as early as possible so do it now #ifndef Q_OS_LINUX @@ -427,13 +429,6 @@ wfmain::~wfmain() #endif logStream->flush(); - - // As this is the end of everything, finally delete the queue. - if(queue) { - qDebug() << "Deleting the queue from within wfmain()."; - queue->deleteLater(); - queue=nullptr; - } } void wfmain::closeEvent(QCloseEvent *event)