diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -135,7 +135,6 @@ Q_SIGNALS: // For RPC command executor - void stopExecutor(); void cmdRequest(const QString &command, const WalletModel *wallet_model); private: diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -818,8 +818,8 @@ } 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(); + // called. + thread.quit(); thread.wait(); } } @@ -1138,12 +1138,8 @@ // 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.