gdiplus: font.c: ensure to release resources

Joris Huizer joris_huizer at yahoo.com
Thu Jun 26 15:15:46 CDT 2008


--- On Thu, 6/26/08, Huw Davies <h.davies1 at physics.ox.ac.uk> wrote:

> 
> You need to select out the hfont before deleting it.
> 
> So the SelectObject should look like
> hfont_old = SelectObject(hdc, hfont);
> then after the
> GetTextMetrics
> do
> DeleteObject(SelectObject(hdc, hfont_old))
> 
> (then you don't need the two sets of DeleteObject)
> 
> Huw.

Thanks, I'll adapt the patch to take this into account.
As you can see, I'm not too familiar with the windows API. As you mention this it kinda makes sence (like, I've seen this done in other parts of the Wine code?), but I couldn't make it up myself

Hope I'll get it right now, sorry for the spam

Joris


      



More information about the wine-devel mailing list