firehose application shutdown

This commit is contained in:
tobtoht 2024-10-01 05:45:21 +02:00
parent 4b197dd49c
commit 37aa04e3e5
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
6 changed files with 12 additions and 6 deletions

View file

@ -79,6 +79,7 @@ Application::Application(int& argc, char** argv)
Application::~Application()
{
qDebug() << "~Application";
if (m_lockFile) {
m_lockFile->unlock();
delete m_lockFile;

View file

@ -1207,6 +1207,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
qDebug() << Q_FUNC_INFO;
if (!this->cleanedUp) {
qDebug() << "MainWindow: cleaning up";
this->cleanedUp = true;
emit aboutToQuit();
@ -1934,5 +1935,5 @@ int MainWindow::findTab(const QString &title) {
}
MainWindow::~MainWindow() {
qDebug() << "~MainWindow";
qDebug() << "~MainWindow" << QThread::currentThreadId();
}

View file

@ -67,7 +67,7 @@ WindowManager::~WindowManager() {
qDebug() << "~WindowManager";
m_cleanupThread->quit();
m_cleanupThread->wait();
qDebug() << "Cleanup thread done";
qDebug() << "WindowManager: cleanup thread done" << QThread::currentThreadId();
}
// ######################## APPLICATION LIFECYCLE ########################
@ -82,7 +82,7 @@ void WindowManager::quitAfterLastWindow() {
}
void WindowManager::close() {
qDebug() << Q_FUNC_INFO;
qDebug() << Q_FUNC_INFO << QThread::currentThreadId();
for (const auto &window: m_windows) {
window->close();
}
@ -102,12 +102,14 @@ void WindowManager::close() {
torManager()->stop();
deleteLater();
qDebug() << "Calling QApplication::quit()";
QApplication::quit();
}
void WindowManager::closeWindow(MainWindow *window) {
qDebug() << "closing Window";
qDebug() << "WindowManager: closing Window";
m_windows.removeOne(window);
// Move Wallet to a different thread for cleanup, so it doesn't block GUI thread

View file

@ -1431,7 +1431,7 @@ void Wallet::getTxPoolStatsAsync() {
Wallet::~Wallet()
{
qDebug("~Wallet: Closing wallet");
qDebug() << "~Wallet: Closing wallet" << QThread::currentThreadId();
pauseRefresh();
m_walletImpl->stop();
@ -1448,5 +1448,5 @@ Wallet::~Wallet()
delete m_walletImpl;
m_walletImpl = nullptr;
qDebug("m_walletImpl deleted");
qDebug() << "m_walletImpl deleted" << QThread::currentThreadId();
}

View file

@ -312,6 +312,7 @@ WalletManager::WalletManager(QObject *parent)
WalletManager::~WalletManager()
{
qDebug() << "~WalletManager" << QThread::currentThreadId();
m_scheduler.shutdownWaitForFinished();
}

View file

@ -10,6 +10,7 @@ FutureScheduler::FutureScheduler(QObject *parent)
FutureScheduler::~FutureScheduler()
{
qDebug() << "~FutureScheduler:" << QThread::currentThreadId();
shutdownWaitForFinished();
}