Re: apply ::DeleteObject() for a font?
From: Jeff Partch (jeffp_at_mvps.org)
Date: 04/29/04
- Next message: Julie: "RE: Cannot debug client-side script in VS 6.0"
- Previous message: Leo Violette: "Re: My release version DLL depends on debug version MFC DLLs?"
- In reply to: May Young: "apply ::DeleteObject() for a font?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Apr 2004 19:10:01 -0500
"May Young" <tony@srac.com> wrote in message
news:409042BD.1040201@srac.com...
>
> I have a CFont member, m_myFont, in a class that is initialized in the
> class's ctor below:
>
> LOGFONT logfont;
> ....
> HFONT hFontBody = ::CreateFontIndirect(&logfont);
> m_myFont.Attach(hFontBody);
>
> In the class's destructor, do I have to do the following to avoid
> resource leaking?
> ::DeleteObject(m_myFont);
No.
-- Jeff Partch [VC++ MVP]
- Next message: Julie: "RE: Cannot debug client-side script in VS 6.0"
- Previous message: Leo Violette: "Re: My release version DLL depends on debug version MFC DLLs?"
- In reply to: May Young: "apply ::DeleteObject() for a font?"
- Messages sorted by: [ date ] [ thread ]