[PATCH 2/2] winealsa.drv: Leave the CriticalSection before destroying it. Found by Smatch.

Michael Stefaniuc mstefani at redhat.de
Mon Oct 22 15:46:05 CDT 2007


MSDN says that if a CriticalSection is deleted while it is still hold
all the other threads waiting to aquire the lock will be in an undefined
state.

Independent of the other patch but both are in the same dll and i
needed to number them somehow.
---
 dlls/winealsa.drv/mixer.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dlls/winealsa.drv/mixer.c b/dlls/winealsa.drv/mixer.c
index f1b2e12..daa45a1 100644
--- a/dlls/winealsa.drv/mixer.c
+++ b/dlls/winealsa.drv/mixer.c
@@ -573,6 +573,7 @@ static void ALSA_MixerExit(void)
         EnterCriticalSection(&elem_crst);
         TerminateThread(thread, 1);
         refcnt = 0;
+        LeaveCriticalSection(&elem_crst);
     }
 
     TRACE("Cleaning up\n");
-- 
1.5.3.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20071022/cbe38f10/attachment.pgp 


More information about the wine-patches mailing list