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
3b7dbdecba
commit
412890d838
|
@ -108,8 +108,9 @@ static THREAD_ENTRY _GBAThreadRun(void* context) {
|
||||||
|
|
||||||
while (threadContext->state < THREAD_EXITING) {
|
while (threadContext->state < THREAD_EXITING) {
|
||||||
if (threadContext->debugger) {
|
if (threadContext->debugger) {
|
||||||
ARMDebuggerRun(threadContext->debugger);
|
struct ARMDebugger* debugger = threadContext->debugger;
|
||||||
if (threadContext->debugger->state == DEBUGGER_SHUTDOWN) {
|
ARMDebuggerRun(debugger);
|
||||||
|
if (debugger->state == DEBUGGER_SHUTDOWN) {
|
||||||
_changeState(threadContext, THREAD_EXITING, 0);
|
_changeState(threadContext, THREAD_EXITING, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue