[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: MFC question: is it really necessary to call DeleteObject?

From: Andreas Nicolai <Andreas.Nicolai_at_gmx.net>
Date: 2007-10-10 18:15:54 CEST

Hi Stefan,

> The problem with automatically deleting GDI objects is that you hide
> some problems: you can't really delete a GDI object that's selected into
> a device context. To *really* delete a GDI object, you must first select
> the previous GDI object into the DC, *then* delete the object.
> By using auto-deleting objects, you cheat leak checkers because they
> then won't find the not-really-deleted object.

Hmm, I see the problem and I'm sure there is somewhere a perfect solution
out there. But for now I guess I just go through the code and clean up
objects manually... that's probably the fastest way. At least compared to
writing a wrapper around the device context and implementing an own
SelectObject function to keep track of those things.


Andreas Nicolai                         anicolai@syr.edu
PhD Candidate, M.A.M.E                  (315) 443-2218
Syracuse University
151 Link Hall
Syracuse, NY, 13244
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Wed Oct 10 18:16:07 2007

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.