]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
firehose application shutdown
authortobtoht <tob@featherwallet.org>
Tue, 1 Oct 2024 03:45:21 +0000 (05:45 +0200)
committertobtoht <tob@featherwallet.org>
Tue, 1 Oct 2024 03:45:21 +0000 (05:45 +0200)
src/Application.cpp
src/MainWindow.cpp
src/WindowManager.cpp
src/libwalletqt/Wallet.cpp
src/libwalletqt/WalletManager.cpp
src/utils/scheduler.cpp

index 5758662a4c8f0cbcf2f5da4390586603f0ae5aa3..d4de15f441801ff6481d86d1e110aad9830406ff 100644 (file)
@@ -79,6 +79,7 @@ Application::Application(int& argc, char** argv)
 
 Application::~Application()
 {
+    qDebug() << "~Application";
     if (m_lockFile) {
         m_lockFile->unlock();
         delete m_lockFile;
index 1bcd07b7d006653b8b110e8a2a51a8525020d022..fa2b4c21f75e9f0e4dedfce6e4e3716d7317e179 100644 (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();
 }
\ No newline at end of file
index 2dd5370169ac5efe2ac93eca2890bf950e4b0bdc..d892fec2b963ec3c3f8bfd53df78813d794ee309 100644 (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
index 61fb184a455f99d35e132d8ac4ecc0c0a93a507d..b806bd574208100e2b3036f684f10487b46060b9 100644 (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();
 }
index c34fea451307816b0296f7e94bdf049ee8b413b7..32a4783205de793c26708afd2581dd288b2a6c64 100644 (file)
@@ -312,6 +312,7 @@ WalletManager::WalletManager(QObject *parent)
 
 WalletManager::~WalletManager()
 {
+    qDebug() << "~WalletManager" << QThread::currentThreadId();
     m_scheduler.shutdownWaitForFinished();
 }
 
index 46101654e9e735f049eeeebed7a71a422a13e535..94b40f7081505fec0c07618c96e8146e5ef29e75 100644 (file)
@@ -10,6 +10,7 @@ FutureScheduler::FutureScheduler(QObject *parent)
 
 FutureScheduler::~FutureScheduler()
 {
+    qDebug() << "~FutureScheduler:" << QThread::currentThreadId();
     shutdownWaitForFinished();
 }