chatgui: add shutdown diagnostics (poll exit reason, cleanup steps, app.exec return)

This commit is contained in:
Evgeny committed 2026-07-24 13:56:29 +03:00
1 parent faddbef32a
commit 4c623e25ce
3 files changed
+11 -1

No files matched your search

+7
View File
@@ -344,16 +344,23 @@ void UtunNode::runLoop() {
uasync_poll(ua, 100);
}
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "runLoop: poll exit m_stop=%d g_shutdown=%d", (int)m_stop, (int)g_shutdown);
signal(SIGINT, SIG_DFL);
signal(SIGTERM, SIG_DFL);
g_signal_ua = nullptr;
etcp_router_bind(m_instance, ETCP_RT_ID_CHAT, nullptr);
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "runLoop: etcp_router_unbind done");
chat_sync_destroy(m_instance);
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "runLoop: chat_sync_destroy done");
chat_core_destroy(m_instance);
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "runLoop: chat_core_destroy done");
utun_instance_destroy(m_instance);
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "runLoop: utun_instance_destroy done");
m_instance = nullptr;
uasync_destroy(ua, 0);
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "runLoop: uasync_destroy done, emitting stopped");
g_currentNode = nullptr;
QMetaObject::invokeMethod(this, [this] { emit stopped(); });
}