Does the CRT leak detection facilities of MSVC++ 2005 Express erroneously report leaks on static pointers allocated with new?
When moving my project to this implementation in order to couple it with wxWidgets, I get this one leak on my singleton.
It's a simple class with one std::vector data member. The constructor uses push_back() to fill the vector. There's nothing weird about this singleton (just a straight no-nonsense implementation of Meyer's).
MSVC++ reports two leaks. One in the library's xmemory. When I move down on the stack the culprit is found to be the push_back() in the singleton's constructor. This is 78k long (the whole of the vector plus some more, 14060 elements each a long int).
The second leak (20 bytes long) is what makes me think this is probably a bogus leak report. It's detected inside the getInstance() member function at the point where the static pointer holding the instance gets allocated with new. Now, the language gurantees this pointer gets deleted for me. So, I'm thinking the leak detection facilities don't see past the point where the application exits.
is this so?