ensure rewint is only initialized/deinitialized on main thread

This commit is contained in:
Jamiras 2021-03-05 22:22:31 -07:00
parent 9086d241a7
commit 1b81620d64

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)