mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-22 22:05:11 +00:00
Try to avoid audio callback from working after free
This commit is contained in:
parent
95996ed902
commit
1399b5da47
1 changed files with 2 additions and 1 deletions
|
@ -472,7 +472,7 @@ emu_run(Uxn *u, char *rom)
|
||||||
static int
|
static int
|
||||||
emu_end(Uxn *u)
|
emu_end(Uxn *u)
|
||||||
{
|
{
|
||||||
free(u->ram);
|
SDL_CloseAudioDevice(audio_id);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
|
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
|
||||||
TerminateThread((HANDLE)SDL_GetThreadID(stdin_thread), 0);
|
TerminateThread((HANDLE)SDL_GetThreadID(stdin_thread), 0);
|
||||||
|
@ -480,6 +480,7 @@ emu_end(Uxn *u)
|
||||||
close(0); /* make stdin thread exit */
|
close(0); /* make stdin thread exit */
|
||||||
#endif
|
#endif
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
free(u->ram);
|
||||||
return u->dev[0x0f] & 0x7f;
|
return u->dev[0x0f] & 0x7f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue