Quote:Original post by Evil SteveQuote:Original post by CodaKillerWell, yes it's a memory leak, but Task Manager isn't suitable for checking for memory leaks.
So how should I be checking this? Also I know for a fact that it is creating a memory leak. As I said earlier I fixed it and the reason is quite simple, I needed to Delete the DC and not release control of it.
You can check for handle leaks by using the GDI Objects column in Task Manager, and for memory leaks from your code by using a memory leak checker like mmgr or similar.
If you allocate 500MB of memory and then release it, the OS might realise that you've requested a lot of memory recently and decide to keep it handy for your app. In that case, your application would still show over 500MB used for it's working set, even though there's no actual leak. Similarly, Vista has Superfetch which will slowly allocate memory, even when it's doing nothing (Since otherwise that memory isn't being used) - I've seen people complain that Vista leaks memory because they look at task manager and see the memory usage going up and up.
EDIT: Link to my memory manager: MemMgr.h and MemMgr.cpp. Just drop those files into your project, do a full rebuild, and you'll get a report at shutdown time of any memory leaks.
I added it to my project and defined USE_MMGR, is that all I need to do?