I have a static std::vector in a class. When I use Microsoft's memory leak detection tools:
_CrtMemState state;
_CrtMemCheckpoint( & state);
_CrtMemDumpAllObjectsSince( & state );
it reports a leak after I insert stuff into the vector. This makes sense to me because new space is allocated when something is inserted into the vector. And, this space isn't deallocated until the program terminates (since the vector is static). Is this right?
In the destructor of the class that contains the vector, I'm deleting the object that I put into the vector. However, the memory that's allocated when the insertion happened is still hanging around. Is there anyway to delete this space?
Thanks.