Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to detect GDI leaks with Purify for Windows?

Status
Not open for further replies.

zonesoft

Programmer
Sep 2, 2005
2
US
Hi,

On a MFC application, I get 2 GDI Objects leaks everytime a file is opned and closed. I used a tool called GdiUsage and found out the leak occurs with the frame's icon. My doc class uses CMultiDocTemplate.

I am just wondering if I could use PurifyPlus for Windows (integrated into VC++ 6.0) to detect GDI leaks? It says "WinCheck" feature does detect GDI leaks, but I've been unable to see where that feature is.

If not, any other suggestion to detect GDI leaks?

Thanks a lot!
 
could you please provide more information on what purify is?

Ion Filipski
1c.bmp
 
Purify is a quite powerful memory/resource etc analyzing tool (similar to Bounds Checker)


As for other means to detect GDI leaks - the most trivial (but I've found it useful anyway) is the Task Manager.

Task Manager->Menu->View->Select columns->Check GDI objects.

Run your app and see how its GDI object count is affected...

/Per

www.perfnurt.se
 
Thanks for the replies. I already use the task manager. What I want to know is WHERE the GDI leaks occur in the code...
 
Look in MSDN what functions creates or gets DC. There are pairs of GetDC/ReleaseDC, CreateDC/DeleteDC. See where DC are created and not deleted/released

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top