Skip to content

Commit 1c0e0a5

Browse files
committed
Remove redundant stopThread() signal
1 parent 5da08e0 commit 1c0e0a5

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

src/qt/bitcoin.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ BitcoinApplication::~BitcoinApplication()
212212
if(coreThread)
213213
{
214214
qDebug() << __func__ << ": Stopping thread";
215-
Q_EMIT stopThread();
215+
coreThread->quit();
216216
coreThread->wait();
217217
qDebug() << __func__ << ": Stopped thread";
218218
}
@@ -279,8 +279,7 @@ void BitcoinApplication::startThread()
279279
connect(this, &BitcoinApplication::requestedInitialize, executor, &BitcoinCore::initialize);
280280
connect(this, &BitcoinApplication::requestedShutdown, executor, &BitcoinCore::shutdown);
281281
/* make sure executor object is deleted in its own thread */
282-
connect(this, &BitcoinApplication::stopThread, executor, &QObject::deleteLater);
283-
connect(this, &BitcoinApplication::stopThread, coreThread, &QThread::quit);
282+
connect(coreThread, &QThread::finished, executor, &QObject::deleteLater);
284283

285284
coreThread->start();
286285
}

src/qt/bitcoin.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ public Q_SLOTS:
9999
Q_SIGNALS:
100100
void requestedInitialize();
101101
void requestedShutdown();
102-
void stopThread();
103102
void splashFinished();
104103
void windowShown(BitcoinGUI* window);
105104

src/qt/intro.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Intro::~Intro()
158158
{
159159
delete ui;
160160
/* Ensure thread is finished before it is deleted */
161-
Q_EMIT stopThread();
161+
thread->quit();
162162
thread->wait();
163163
}
164164

@@ -306,8 +306,7 @@ void Intro::startThread()
306306
connect(executor, &FreespaceChecker::reply, this, &Intro::setStatus);
307307
connect(this, &Intro::requestCheck, executor, &FreespaceChecker::check);
308308
/* make sure executor object is deleted in its own thread */
309-
connect(this, &Intro::stopThread, executor, &QObject::deleteLater);
310-
connect(this, &Intro::stopThread, thread, &QThread::quit);
309+
connect(thread, &QThread::finished, executor, &QObject::deleteLater);
311310

312311
thread->start();
313312
}

src/qt/intro.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class Intro : public QDialog
5454

5555
Q_SIGNALS:
5656
void requestCheck();
57-
void stopThread();
5857

5958
public Q_SLOTS:
6059
void setStatus(int status, const QString &message, quint64 bytesAvailable);

0 commit comments

Comments
 (0)