Tools to find GDI Memory Leaks

May 26, 2012 at 8:50am
I have some code that results in leaked GDI resources. I can tell because when I run the program and view the GDI handles in Task Manager the number simply keeps rising and the program eventually crashes. I am trying to pinpoint to the problem and was wondering if there are any tools that will help me do so.

Also any advice on finding GDI memory leaks would be appreciated.
May 28, 2012 at 8:29pm
You should provide me source.
I hope that I'll help you. :)
May 28, 2012 at 9:17pm
You should only be making GDI related calls in a limited number of places, so it shouldn't be hard to track down where it's happening.

I take it you are remembering to call DeleteObject when you've finished with any pens, brushes, etc you created?

MSDN article:
Detect and Plug GDI Leaks in Your Code with Two Powerful Tools for Windows XP
http://msdn.microsoft.com/en-us/magazine/cc188782.aspx

(for Windows XP, but might/should still be of use...)
Last edited on May 28, 2012 at 9:17pm
May 29, 2012 at 7:30pm
Try Deleaker or other debugger for GDI leaks.
May 30, 2012 at 7:43pm
Thanks to all! I think that problem is solved. :)
May 31, 2012 at 8:47pm
Good luck ! :)
Topic archived. No new replies allowed.