From 56475e578bc27ab79aa34047dda1bf6c3fbd4106 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 21 Feb 2015 02:01:55 -0800 Subject: [PATCH] Qt: Fix crash when starting GDB stub after closing a game --- CHANGES | 1 + src/platform/qt/GameController.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 2845ad018..6c3568d10 100644 --- a/CHANGES +++ b/CHANGES @@ -42,6 +42,7 @@ Bugfixes: - GBA: Fix savestate loading of DISPSTAT and WAITCNT registers - Qt: Fix crash starting a GDB stub if a game isn't loaded - Qt: Fix crash when adjusting settings after closing a game + - Qt: Fix crash when starting GDB stub after closing a game Misc: - GBA Audio: Change internal audio sample buffer from 32-bit to 16-bit samples - GBA Memory: Simplify memory API and use fixed bus width diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index eff59a9e8..c691262d3 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -170,11 +170,11 @@ ARMDebugger* GameController::debugger() { void GameController::setDebugger(ARMDebugger* debugger) { threadInterrupt(); - if (m_threadContext.debugger && GBAThreadHasStarted(&m_threadContext)) { + if (m_threadContext.debugger && GBAThreadIsActive(&m_threadContext)) { GBADetachDebugger(m_threadContext.gba); } m_threadContext.debugger = debugger; - if (m_threadContext.debugger && GBAThreadHasStarted(&m_threadContext)) { + if (m_threadContext.debugger && GBAThreadIsActive(&m_threadContext)) { GBAAttachDebugger(m_threadContext.gba, m_threadContext.debugger); } threadContinue();