why i’m getting the memory leak errors without allocating or adding any elements to list below. should i just ignore it?
#define CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#include <list>
using std::list;
int main()
{
list <char*> roots;
_CrtDumpMemoryLeaks();
}
You are not giving the
rootsvariable a chance to be destroyed before checking for memory leaks. Ifrootsis destroyed first, you should notice that everything is cleaned up. Try this instead.