Skip to content

Commit

Permalink
Remove redundant stopThread() signal
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jan 9, 2019
1 parent 5da08e0 commit 1c0e0a5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ BitcoinApplication::~BitcoinApplication()
if(coreThread)
{
qDebug() << __func__ << ": Stopping thread";
Q_EMIT stopThread();
coreThread->quit();
coreThread->wait();
qDebug() << __func__ << ": Stopped thread";
}
Expand Down Expand Up @@ -279,8 +279,7 @@ void BitcoinApplication::startThread()
connect(this, &BitcoinApplication::requestedInitialize, executor, &BitcoinCore::initialize);
connect(this, &BitcoinApplication::requestedShutdown, executor, &BitcoinCore::shutdown);
/* make sure executor object is deleted in its own thread */
connect(this, &BitcoinApplication::stopThread, executor, &QObject::deleteLater);
connect(this, &BitcoinApplication::stopThread, coreThread, &QThread::quit);
connect(coreThread, &QThread::finished, executor, &QObject::deleteLater);

coreThread->start();
}
Expand Down
1 change: 0 additions & 1 deletion src/qt/bitcoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public Q_SLOTS:
Q_SIGNALS:
void requestedInitialize();
void requestedShutdown();
void stopThread();
void splashFinished();
void windowShown(BitcoinGUI* window);

Expand Down
5 changes: 2 additions & 3 deletions src/qt/intro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Intro::~Intro()
{
delete ui;
/* Ensure thread is finished before it is deleted */
Q_EMIT stopThread();
thread->quit();
thread->wait();
}

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

thread->start();
}
Expand Down
1 change: 0 additions & 1 deletion src/qt/intro.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class Intro : public QDialog

Q_SIGNALS:
void requestCheck();
void stopThread();

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

0 comments on commit 1c0e0a5

Please sign in to comment.