diff --git a/CHANGES b/CHANGES index 8e995f274..7624b8312 100644 --- a/CHANGES +++ b/CHANGES @@ -35,6 +35,7 @@ Emulation fixes: Other fixes: - 3DS: Ensure writes update file modification time (fixes mgba.io/i/2444) - Core: Don't attempt to restore rewind diffs past start of rewind + - Core: Fix the runloop resuming after a game has crashed (fixes mgba.io/i/2451) - FFmpeg: Fix crash when encoding audio with some containers - FFmpeg: Fix GIF recording (fixes mgba.io/i/2393) - GB: Fix temporary saves diff --git a/include/mgba/core/thread.h b/include/mgba/core/thread.h index 9f790cfe5..62605aa7f 100644 --- a/include/mgba/core/thread.h +++ b/include/mgba/core/thread.h @@ -54,14 +54,15 @@ enum mCoreThreadState { mTHREAD_INTERRUPTED, mTHREAD_PAUSED, - mTHREAD_MIN_WAITING = mTHREAD_INTERRUPTED, mTHREAD_CRASHED, - mTHREAD_MAX_WAITING = mTHREAD_PAUSED, mTHREAD_INTERRUPTING, mTHREAD_EXITING, - mTHREAD_SHUTDOWN + mTHREAD_SHUTDOWN, + + mTHREAD_MIN_WAITING = mTHREAD_INTERRUPTED, + mTHREAD_MAX_WAITING = mTHREAD_CRASHED }; enum mCoreThreadRequest { diff --git a/src/core/thread.c b/src/core/thread.c index de8a74987..1a9378a77 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -468,7 +468,7 @@ bool mCoreThreadIsActive(struct mCoreThread* threadContext) { if (!threadContext->impl) { return false; } - return threadContext->impl->state >= mTHREAD_RUNNING && threadContext->impl->state < mTHREAD_EXITING; + return threadContext->impl->state >= mTHREAD_RUNNING && threadContext->impl->state < mTHREAD_EXITING && threadContext->impl->state != mTHREAD_CRASHED; } void mCoreThreadInterrupt(struct mCoreThread* threadContext) {