sdl: fix shutdown hang on MacOS when SDL threads are used

Change-Id: I2179d2beed89beba1716072fc06b9cc090118364
This commit is contained in:
Christian Soffke 2024-12-27 11:45:04 +01:00
parent dca70e1816
commit 5e09a9246c

View file

@ -157,6 +157,9 @@ void power_off(void)
/* since sim_thread_shutdown() grabs the mutex we need to let it free,
* otherwise SDL_WaitThread will deadlock */
struct thread_entry* t = sim_thread_unlock();
if (!evt_thread) /* no event thread on MacOS */
sim_thread_shutdown();
#endif
/* wait for event thread to finish */
SDL_WaitThread(evt_thread, NULL);