Skip to content

Commit

Permalink
qt: Replace QCoreApplication::quit() with QCoreApplication::exit(0)
Browse files Browse the repository at this point in the history
Qt 5:
 - no behavior change

Qt 6:
 - this change avoids sending a duplicated `QEvent::Quit`
  • Loading branch information
hebasto committed May 21, 2022
1 parent d1b3dfb commit 252f363
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ void BitcoinApplication::startThread()

/* communication to and from thread */
connect(&m_executor.value(), &InitExecutor::initializeResult, this, &BitcoinApplication::initializeResult);
connect(&m_executor.value(), &InitExecutor::shutdownResult, this, &QCoreApplication::quit);
connect(&m_executor.value(), &InitExecutor::shutdownResult, this, [] {
QCoreApplication::exit(0);
});
connect(&m_executor.value(), &InitExecutor::runawayException, this, &BitcoinApplication::handleRunawayException);
connect(this, &BitcoinApplication::requestedInitialize, &m_executor.value(), &InitExecutor::initialize);
connect(this, &BitcoinApplication::requestedShutdown, &m_executor.value(), &InitExecutor::shutdown);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/test/apptests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ AppTests::HandleCallback::~HandleCallback()
assert(it != callbacks.end());
callbacks.erase(it);
if (callbacks.empty()) {
m_app_tests.m_app.quit();
m_app_tests.m_app.exit(0);
}
}

0 comments on commit 252f363

Please sign in to comment.