diff --git a/CHANGES b/CHANGES index 94459b0c1..4607a27b8 100644 --- a/CHANGES +++ b/CHANGES @@ -35,6 +35,7 @@ Bugfixes: - SDL: Fix race condition with audio thread when starting - GB: Fix flickering when screen is strobed quickly - FFmpeg: Fix overflow and general issues with audio encoding + - Qt: Fix crash when changing audio settings after a game is closed Misc: - SDL: Remove scancode key input - GBA Video: Clean up unused timers diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index bf81defd0..6c73d06e8 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -654,6 +654,7 @@ void GameController::cleanGame() { delete[] m_frontBuffer; m_threadContext.core->deinit(m_threadContext.core); + m_threadContext.core = nullptr; m_gameOpen = false; } @@ -1222,7 +1223,7 @@ void GameController::updateKeys() { } void GameController::redoSamples(int samples) { - if (m_threadContext.core) { + if (m_gameOpen && m_threadContext.core) { m_threadContext.core->setAudioBufferSize(m_threadContext.core, samples); } m_audioProcessor->inputParametersChanged();