diff --git a/CHANGES b/CHANGES index 6b26e6bc8..ad269f26b 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ Emulation fixes: - GBA Memory: Make VRAM access stalls only apply to BG RAM Other fixes: + - Core: Allow sending thread requests to a crashed core (fixes mgba.io/i/2785) - Qt: Fix crash when attempting to use OpenGL 2.1 to 3.1 (fixes mgba.io/i/2794) - Qt: Disable sync while running scripts from main thread (fixes mgba.io/i/2738) Misc: diff --git a/src/core/thread.c b/src/core/thread.c index 7101b5a54..510e45f98 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -58,8 +58,19 @@ static void _waitOnInterrupt(struct mCoreThreadInternal* threadContext) { } static void _pokeRequest(struct mCoreThreadInternal* threadContext) { - if (threadContext->state == mTHREAD_RUNNING || threadContext->state == mTHREAD_PAUSED) { + switch (threadContext->state) { + case mTHREAD_RUNNING: + case mTHREAD_PAUSED: + case mTHREAD_CRASHED: threadContext->state = mTHREAD_REQUEST; + break; + case mTHREAD_INITIALIZED: + case mTHREAD_REQUEST: + case mTHREAD_INTERRUPTED: + case mTHREAD_INTERRUPTING: + case mTHREAD_EXITING: + case mTHREAD_SHUTDOWN: + break; } }