diff --git a/src/gba/gba.c b/src/gba/gba.c index 111276452..583bf59a5 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -613,13 +613,17 @@ static void _GBAVLog(struct GBA* gba, enum GBALogLevel level, const char* format if (threadContext) { logLevel = threadContext->logLevel; + gba = threadContext->gba; } if (!(level & logLevel) && level != GBA_LOG_FATAL) { return; } - gba->cpu->nextEvent = 0; + if (level == GBA_LOG_FATAL && gba) { + gba->cpu->nextEvent = 0; + } + if (threadContext) { if (level == GBA_LOG_FATAL) { MutexLock(&threadContext->stateMutex);