Reputation: 12218
After running some hours my application fails in creating a new font object:
CreateFontIndirect() returns NULL.
I know how to find memory leaks (i.e. using parallel inspector or another profiler - most of them include leak detection). But how can I locate a resource leak in Win32?
Upvotes: 4
Views: 1882
Reputation: 7946
It looks like the MSDN article Resource Leaks: Detecting, Locating, and Repairing Your Leaky GDI Code(via archive.org) might provide you with an answer.
Upvotes: 5
Reputation: 78598
Grab yourself a copy of GDI View - this useful tool can show all the GDI objects used by your app, including details on the font name, size, etc. This has proved very handy in the past.
For Win32 apps you might want to look at the WTL framework - this wraps GDI objects with lightweight C++ classes that will handle object deletion for you.
Upvotes: 8
Reputation: 3371
If you have BoundsChecker, it tracks resource leaks in addition to memory leaks.
Upvotes: 2