Re: GDI Object Select leak question

"todd" <timza1221-/[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>

I found that neglecting to not re-select the previous object did NOT cause my memory leaks.
I have 2 that I have found right now.

1) was obvious, I would call a function and use GetDC() as a parameter.
BAD IDEA. That DC was never released. Easy to find.

2) Less Obvious was the use of CImageList. The CImageList destructor does not Destroy() the bitmap loaded.  In the destructor using CImageList, you have to call CImageList::Destroy() otherwise, I had 2 gdi handles leaked each time.

Thanks!

It's easy to see that you're leaking but sometimes hard to find the leak.  That's where really good code organization shows; it is almost measurable in time to find the source of the leaks.





--- In [email protected], Igor Vigdorchik <igorv007@...> wrote:
>
> There is even an easier way  - GDIView
> http://www.nirsoft.net/utils/gdi_handles.html
> 
> Regards,
> Igor.
> 
> 
> 
> ________________________________
> From: umeca74 <umeca74@...>
> To: [email protected]
> Sent: Wed, February 3, 2010 11:34:41 AM
> Subject: [wtl] Re: GDI Object Select leak question
> 
>   
> here's an easy way to check for GDI leaks
> 
> open the task manager, switch to PROCESSES tab, activate the "GDI Objects" column, then find your program and observe if this counter goes up or not
> 
> 
> 
> 
> 
>       
> 
> [Non-text portions of this message have been removed]
>



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.