Archived

This topic is now archived and is closed to further replies.

edwinnie

detecting mem leaks if have singleton

Recommended Posts

okies...=) lets say i got a program uses a singleton (loki), and i need to detect mem leaks (if there are any), without the problem of detecting the singleton as leaking, i mean how do i do that since _CrtDumpMemoryLeaks() is usually placed at the end of the program, and the singleton being only removed after the program exited? thx! Edwin

Share this post


Link to post
Share on other sites
Well one thought is that if you know that the memory leak being dumped is your singleton, you can ignore it.

Also you can change Loki''s singleton to use static storage rather than heap memory, so it won''t show up on the leak detector. You do this by using the CreateStatic<> policy.

Share this post


Link to post
Share on other sites