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@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-07-29 15:09:33 +01:00 committed by Alexandre Julliard
parent e1130cbb99
commit d4d65e2df9
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}