mirror of https://github.com/mgba-emu/mgba.git
Debugger can get detached during a callback, clean up appropriately
This commit is contained in:
parent
243cf2236b
commit
56c51181e1
|
@ -108,8 +108,9 @@ static THREAD_ENTRY _GBAThreadRun(void* context) {
|
|||
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue