all repos — mgba @ 412890d8384bfdca42fcd6f2e1d2a3af5c85b564

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

412890d8384bfdca42fcd6f2e1d2a3af5c85b564

parent

3b7dbdecbac880fc204a42384151bf34ed35837c

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 {