Merge pull request #12104 from Jamiras/cheevos/rewind_threaded

(cheevos) ensure rewind is only initialized/deinitialized on main thread
This commit is contained in:
Autechre 2021-03-06 06:44:23 +01:00 committed by GitHub
commit 07146047f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1584,7 +1584,14 @@ static void rcheevos_toggle_hardcore_active(rcheevos_locals_t* locals)
/* deinit rewind */
if (rewind_enable)
{
#ifdef HAVE_THREADS
/* have to "schedule" this. CMD_EVENT_REWIND_DEINIT should only be called on the main thread */
rcheevos_locals.queued_command = CMD_EVENT_REWIND_DEINIT;
#else
command_event(CMD_EVENT_REWIND_DEINIT, NULL);
#endif
}
}
else
{
@ -1601,7 +1608,14 @@ static void rcheevos_toggle_hardcore_active(rcheevos_locals_t* locals)
/* re-init rewind */
if (rewind_enable)
{
#ifdef HAVE_THREADS
/* have to "schedule" this. CMD_EVENT_REWIND_INIT should only be called on the main thread */
rcheevos_locals.queued_command = CMD_EVENT_REWIND_INIT;
#else
command_event(CMD_EVENT_REWIND_INIT, NULL);
#endif
}
}
if (locals->loaded)