[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: Hans-Werner Dietz <hans-werner.dietz_at_dbt.de>
Date: 2007-10-11 09:28:22 CEST

Andreas Nicolai schrieb:
> 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
>
Hi Andreas,

Stefan is right, the wrapper has to be be a little bit bigger. Some
years ago I use something like this in a program I write for my son's
toy railroad. If you like the idea, I can look for it at the weekend and
post the code at monday.

Hans-Werner

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Thu Oct 11 09:30:56 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.