Skip to content

Commit

Permalink
Remove redundant stopExecutor() signal
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jan 9, 2019
1 parent 1c0e0a5 commit 24313fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 3 additions & 7 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,7 @@ void RPCConsole::setClientModel(ClientModel *model)
}
if (!model) {
// Client model is being set to 0, this means shutdown() is about to be called.
// Make sure we clean up the executor thread
Q_EMIT stopExecutor();
thread.quit();
thread.wait();
}
}
Expand Down Expand Up @@ -975,11 +974,8 @@ void RPCConsole::startExecutor()
// Requests from this object must go to executor
connect(this, &RPCConsole::cmdRequest, executor, &RPCExecutor::request);

// On stopExecutor signal
// - quit the Qt event loop in the execution thread
connect(this, &RPCConsole::stopExecutor, &thread, &QThread::quit);
// - queue executor for deletion (in execution thread)
connect(&thread, &QThread::finished, executor, &RPCExecutor::deleteLater, Qt::DirectConnection);
// Make sure executor object is deleted in its own thread
connect(&thread, &QThread::finished, executor, &RPCExecutor::deleteLater);

// Default implementation of QThread::run() simply spins up an event loop in the thread,
// which is what we want.
Expand Down
1 change: 0 additions & 1 deletion src/qt/rpcconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ public Q_SLOTS:

Q_SIGNALS:
// For RPC command executor
void stopExecutor();
void cmdRequest(const QString &command, const WalletModel* wallet_model);

private:
Expand Down

0 comments on commit 24313fb

Please sign in to comment.