dib: fix deadlock (resend)
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Tue Feb 22 12:29:06 CST 2005
Sending again, as it apparently didn't make it to Alexandre's mailbox.
Huw Davies <huw at codeweavers.com>
Don't hold the GDI lock when calling DC_GetDCUpdate.
Index: dlls/gdi/dib.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/dib.c,v
retrieving revision 1.8
diff -u -p -r1.8 dib.c
--- dlls/gdi/dib.c 14 Feb 2005 11:08:22 -0000 1.8
+++ dlls/gdi/dib.c 21 Feb 2005 12:19:22 -0000
@@ -314,12 +314,15 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP h
BITMAPOBJ *bitmap;
INT result = 0;
- if (!(bitmap = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) return 0;
-
if (!(dc = DC_GetDCUpdate( hdc )))
{
if (coloruse == DIB_RGB_COLORS) FIXME( "shouldn't require a DC for DIB_RGB_COLORS\n" );
- GDI_ReleaseObj( hbitmap );
+ return 0;
+ }
+
+ if (!(bitmap = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
+ {
+ GDI_ReleaseObj( hdc );
return 0;
}
@@ -332,8 +335,8 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP h
result = lines;
done:
- GDI_ReleaseObj( hdc );
GDI_ReleaseObj( hbitmap );
+ GDI_ReleaseObj( hdc );
return result;
}
More information about the wine-patches
mailing list