all repos — mgba @ 56c51181e1fa5b9c6a9cebc469771adee2f4cc21

mGBA Game Boy Advance Emulator

Debugger can get detached during a callback, clean up appropriately
Jeffrey Pfau jeffrey@endrift.com
Sun, 02 Feb 2014 03:57:41 -0800
commit

56c51181e1fa5b9c6a9cebc469771adee2f4cc21

parent

243cf2236b7e7f9c39585a65c6940c61935b9dfa

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M src/gba/gba-thread.csrc/gba/gba-thread.c

@@ -108,8 +108,9 @@ _changeState(threadContext, THREAD_RUNNING, 1);

while (threadContext->state < THREAD_EXITING) { if (threadContext->debugger) { - ARMDebuggerRun(threadContext->debugger); - if (threadContext->debugger->state == DEBUGGER_SHUTDOWN) { + struct ARMDebugger* debugger = threadContext->debugger; + ARMDebuggerRun(debugger); + if (debugger->state == DEBUGGER_SHUTDOWN) { _changeState(threadContext, THREAD_EXITING, 0); } } else {