chatgui: move SoundManager shutdown to ~MainWindow before node cleanup

- SoundManager::shutdown() called explicitly in ~MainWindow (not static destruction)
- Before ma_engine_uninit: DEBUG_INFO diagnostic in timestamped log
- After ma_engine_uninit: DEBUG_INFO diagnostic
- Double-call safe: static destructor hits m_initialized=false, returns immediately
This commit is contained in:
Evgeny committed 2026-07-24 14:22:28 +03:00
1 parent fbaf58530f
commit 0d558245ce
2 files changed
+4 -1

No files matched your search

+3 -1
View File
@@ -3,6 +3,7 @@
#include "sound_manager.h"
#include <QFile>
#include <QDebug>
#include "../../lib/debug_config.h"
SoundManager* SoundManager::instance() {
static SoundManager s;
@@ -36,9 +37,10 @@ void SoundManager::shutdown() {
}
m_sounds.clear();
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "SoundManager: before ma_engine_uninit engine=%p", (void*)m_engine);
if (m_engine) { ma_engine_uninit(m_engine); delete m_engine; m_engine = nullptr; }
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "SoundManager: after ma_engine_uninit");
m_initialized = false;
qDebug("SoundManager: shutdown");
}
void SoundManager::setEnabled(bool enabled) { m_enabled = enabled; }