···157157 /* since sim_thread_shutdown() grabs the mutex we need to let it free,
158158 * otherwise SDL_WaitThread will deadlock */
159159 struct thread_entry* t = sim_thread_unlock();
160160+161161+ if (!evt_thread) /* no event thread on MacOS */
162162+ sim_thread_shutdown();
160163#endif
161164 /* wait for event thread to finish */
162165 SDL_WaitThread(evt_thread, NULL);