0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-05 13:55:06 +00:00

Try to avoid audio callback from working after free

This commit is contained in:
Bad Diode 2023-10-17 20:16:47 +02:00 committed by neauoire
parent 2c3f9f0f47
commit 0f3b070313

View file

@ -509,7 +509,7 @@ emu_run(Uxn *u, char *rom)
static int
emu_end(Uxn *u)
{
free(u->ram);
SDL_CloseAudioDevice(audio_id);
#ifdef _WIN32
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
TerminateThread((HANDLE)SDL_GetThreadID(stdin_thread), 0);
@ -517,6 +517,7 @@ emu_end(Uxn *u)
close(0); /* make stdin thread exit */
#endif
SDL_Quit();
free(u->ram);
return u->dev[0x0f] & 0x7f;
}