chatgui: add shutdown diagnostics — ~DbManager, ~SoundManager, g_shutdown_sentinel

Three diagnostic points covering the gap between ~MainWindow done and CRT exit:
- DbManager: destroyed — confirms local dtors started after ~MainWindow
- SoundManager: static destructor entered — confirms static destruction phase
- main: static destructors done (g_shutdown_sentinel dtor) — confirms ALL statics done

If process hangs, we know exactly which phase failed.
This commit is contained in:
Evgeny committed 2026-07-24 14:34:00 +03:00
1 parent 0d558245ce
commit 74c6b0d102
3 files changed
+14 -2

No files matched your search

+8 -1
View File
@@ -10,6 +10,7 @@
#include "../db/db_manager.h"
#include "../transport/node_config.h"
#include "../transport/utun_node.h"
#include "../../lib/debug_config.h"
#ifdef _WIN32
static UtunNode* g_ctrl_node = nullptr;
@@ -23,6 +24,12 @@ static BOOL WINAPI console_ctrl_handler(DWORD dwCtrlType) {
}
#endif
static struct ShutdownSentinel {
~ShutdownSentinel() {
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "main: static destructors done");
}
} g_shutdown_sentinel;
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
app.setApplicationName("Chat");
@@ -98,6 +105,6 @@ int main(int argc, char *argv[]) {
#endif
int ret = app.exec();
qDebug("main: app.exec() returned %d", ret);
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "main: app.exec() returned %d", ret);
return ret;
}