(try 2) gdi32: Fix a deadlock in FONT_SelectObject.
Liu Qishuai
lqs.buaa at gmail.com
Thu Jul 3 10:19:49 CDT 2008
Hi,
This patch fixes a deadlock in FONT_SelectObject, which may cause Picasa hang on startup.
WineEngCreateFontInstance should not be called if GDI lock is hold.
---
dlls/gdi32/font.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 91e41e7..7377594 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -488,8 +488,9 @@ static HGDIOBJ FONT_SelectObject( HGDIOBJ handle, HDC hdc )
{
if(GetDeviceCaps(dc->hSelf, TEXTCAPS) & TC_VA_ABLE)
{
+ GdiFont *gdiFont = WineEngCreateFontInstance(dc, handle);
FONTOBJ *font = GDI_GetObjPtr( handle, FONT_MAGIC ); /* to grab the GDI lock (FIXME) */
- dc->gdiFont = WineEngCreateFontInstance(dc, handle);
+ dc->gdiFont = gdiFont;
if (font) GDI_ReleaseObj( handle );
}
}
--
1.5.4.3
More information about the wine-patches
mailing list