I'm trying to locate a memory leak issue.
My project is an ATL based dialog project, that uses DirectShow and the standard library.
I get a total of 45 memory leaks in my program, all 24 bytes each.
I've #define'd _CRTDBG_MAP_ALLOC etc in my stdafx.h, along with DEBUG_NEW to get the file and line numbers for each of the memory leaks.
However, no file line numbers are printed. The memory blocks are all "normal" blocks and look like this:
{180} normal block at 0x003E6008, 24 bytes long. Data: < > _> > W > A0 AE 3E 00 B0 5F 3E 00 A0 AE 3E 00 57 00 00 00
I've tried adding the following line to the start of _tWinMain()
_CrtSetBreakAlloc(180);
in order to break on the allocation, but the debugger doesn't break at all.
Can anyone give me any insight into how I might track down the elusive memory leaks?
Finally, here's my _tWinMain() - I call _CrtDumpMemoryLeaks() just before exiting.
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow){
_CrtSetBreakAlloc(180);
HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
ATLASSERT(SUCCEEDED(hRes));
::DefWindowProc(NULL, 0, 0, 0L);
AtlInitCommonControls(ICC_BAR_CLASSES);
//HINSTANCE hInstRich = ::LoadLibrary(CRichEditCtrl::GetLibraryName());
hRes = _Module.Init(NULL, hInstance);
ATLASSERT(SUCCEEDED(hRes));
int nRet = Run(lpstrCmdLine, nCmdShow);
_Module.Term();
::CoUninitialize();
_CrtDumpMemoryLeaks();
return nRet;
}