Archived

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

detecting mem leaks if have singleton

This topic is 5013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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