Huw Davies : gdi32: Move the release until after the final dc access.
Alexandre Julliard
julliard at winehq.org
Fri Jul 29 10:17:09 CDT 2016
Module: wine
Branch: master
Commit: d4d65e2df9c465f02a06ca91c847dd575c0df6ea
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d4d65e2df9c465f02a06ca91c847dd575c0df6ea
Author: Huw Davies <huw at codeweavers.com>
Date: Fri Jul 29 15:09:33 2016 +0100
gdi32: Move the release until after the final dc access.
Also only reselect the font if the graphics mode changes.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdi32/dc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index 59a3d9b..3b6c2ea 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -1037,9 +1037,9 @@ INT WINAPI SetGraphicsMode( HDC hdc, INT mode )
ret = dc->GraphicsMode;
dc->GraphicsMode = mode;
}
- release_dc_ptr( dc );
/* font metrics depend on the graphics mode */
- if (ret) SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf, OBJ_FONT));
+ if (ret != mode) SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf, OBJ_FONT));
+ release_dc_ptr( dc );
return ret;
}
More information about the wine-cvs
mailing list