From 014c3c90e0347142cf2420a801207d749dfb82fe Mon Sep 17 00:00:00 2001 From: Themaister Date: Fri, 5 Aug 2011 02:57:30 +0200 Subject: [PATCH] Fix possible race condition. --- audio/dsound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);