_CrtDumpMemoryLeaks returning false information
I have a simple Win32 dll that has one global object that contains several STL lists that hold pointers to classes (ie: std::list<myclass*> ). The class constructor is called prior to DLLMain.
When my DllMain is called with DLL_PROCESS_ATTACH, I call the function debug function,
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
If I shut down the app prior to calling any function in the DLL, the
function, _CrtDumpMemoryLeaks(), is called automatically prior to the destructor of my global object. Thus I see memory leaks reported in the debug window. What appears to be a leak is the list classes which have not had any objects placed in them!
However, in tracing through my constructor, I see an empty head node placed in the list.
Is this behavior normal or is this a side effect of using STL to hold pointers?
Additionally, I have used the debug new feature:
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
with the
#ifdef _DEBUG
#define DEBUG_NEW new( _NORMAL_BLOCK, __FILE__, __LINE__)
#else
#define DEBUG_NEW
#endif
Thanks for your insights,
Jim

