diff --git a/audio/dsound.c b/audio/dsound.c index 313220d2c9..7ea985606d 100644 --- a/audio/dsound.c +++ b/audio/dsound.c @@ -192,8 +192,6 @@ static void dsound_free(void *data) dsound_t *ds = data; if (ds) { - DeleteCriticalSection(&ds->crit); - if (ds->thread) { ds->thread_alive = false; @@ -201,6 +199,8 @@ static void dsound_free(void *data) CloseHandle(ds->thread); } + DeleteCriticalSection(&ds->crit); + if (ds->dsb) { IDirectSoundBuffer_Stop(ds->dsb);