Visual C ++ detected memory leaks in my code, so I reduced it to the simplest test case as I could, and got the following:
#define _CRTDBG_MAP_ALLOC // required #include <stdlib.h> // to enable MSVC++ #include <crtdbg.h> // memory leak detection #include <string> using namespace std; int main() { string foo; _CrtDumpMemoryLeaks(); return 0; }
Output:
Detected memory leaks!
Dumping objects ->
{130} normal block at 0x008748A8, 8 bytes long.
Data: B4 F9 44 00 00 00 00 00
Object dump complete. If I comment on "string foo;" he discovers nothing.
Do I have to somehow free foo?
source share