Re: [PATCH 08/10] gdi32: Where possible directly access the DC instead of using GetCurrentObject().
Huw Davies <huw(a)codeweavers.com> writes:
@@ -1039,7 +1039,7 @@ INT WINAPI SetGraphicsMode( HDC hdc, INT mode ) } release_dc_ptr( dc ); /* font metrics depend on the graphics mode */ - if (ret) SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf, OBJ_FONT)); + if (ret) SelectObject(dc->hSelf, dc->hFont);
The bug was already present, but we shouldn't be accessing the dc after release. -- Alexandre Julliard julliard(a)winehq.org
On Fri, Jul 29, 2016 at 09:22:43PM +0900, Alexandre Julliard wrote:
Huw Davies <huw(a)codeweavers.com> writes:
@@ -1039,7 +1039,7 @@ INT WINAPI SetGraphicsMode( HDC hdc, INT mode ) } release_dc_ptr( dc ); /* font metrics depend on the graphics mode */ - if (ret) SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf, OBJ_FONT)); + if (ret) SelectObject(dc->hSelf, dc->hFont);
The bug was already present, but we shouldn't be accessing the dc after release.
Good catch (although it was originally your bug ;-) ) I've resent the entire series with an additional patch [8/11] which fixes this. It also only reselects the font if the mode changes. The other patches in the series are essentially the same as v1. Huw.
Huw Davies <huw(a)codeweavers.com> writes:
On Fri, Jul 29, 2016 at 09:22:43PM +0900, Alexandre Julliard wrote:
Huw Davies <huw(a)codeweavers.com> writes:
@@ -1039,7 +1039,7 @@ INT WINAPI SetGraphicsMode( HDC hdc, INT mode ) } release_dc_ptr( dc ); /* font metrics depend on the graphics mode */ - if (ret) SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf, OBJ_FONT)); + if (ret) SelectObject(dc->hSelf, dc->hFont);
The bug was already present, but we shouldn't be accessing the dc after release.
Good catch (although it was originally your bug ;-) )
Then it can't be a bug. There are no bugs in my code. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Huw Davies