Commit d4d65e2d authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Move the release until after the final dc access.

Also only reselect the font if the graphics mode changes. Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent e1130cbb
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment