Missing LeaveCriticalSection on error paths (found by Smatch).

Michael Stefaniuc mstefani at redhat.de
Thu Jun 1 18:02:37 CDT 2006


can somebody more familiar with this code confirm that on the error
paths the CriticalSection should be released? I'm not sure about it as
the function is supposed to keep the lock held when exiting without
error; there is a d3ddevice_unlock_update() function that releases the


 dlls/ddraw/device_opengl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/ddraw/device_opengl.c b/dlls/ddraw/device_opengl.c
index d19996e..4c663a6 100644
--- a/dlls/ddraw/device_opengl.c
+++ b/dlls/ddraw/device_opengl.c
@@ -3775,10 +3775,12 @@ static void d3ddevice_lock_update(IDirec
 		buffer_color = GL_BGRA;
 	    } else {
 		ERR(" unsupported pixel format at device locking.\n");
+                LeaveCriticalSection(&(d3d_dev->crit));
 	} else {
 	    ERR(" unsupported pixel format at device locking - alpha on frame buffer.\n");
+            LeaveCriticalSection(&(d3d_dev->crit));

Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart
-------------- 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/20060602/a314260e/attachment.pgp

More information about the wine-patches mailing list