<p>I use Visual Studio 2012 and VLD 2.2.3.</p>
<p>Compile option /MTd.</p>
<p>Memory leak is reported with the next code.</p>
<p> </p>
<p>int _tmain(int argc, _TCHAR* argv[])</p>
<p>{</p>
<p> return 0;</p>
<p>}</p>
<p> </p>
<p>VisualLeakDetector::_HeapCreate() dose not seem to be called...</p>
<p> </p>
<p>*I use machine translation, I cannot express it well.</p>
Comments: I have managed to slightly debug the root cause of this problem with Visual Studio 2012 and Windows 7. It reproduces with Visual Studio 2012 (v110) platform toolset and Multi-threaded Debug (/MTd) option only (static CRT). It works (ie. no CRT leaks in the output) when setting either Multi-threaded Debug DLL (/MDd) option or Visual Studio 2010 (v100) platform toolset. When comparing what is happening inside vld code I can see that with the 2010 platform toolset VLD is setting the VLD_HEAP_CRT_DBG flag in _HeapCreate function because it is called from the _heap_init CRT function. This function calls HeapCreate which is captured by VLD. With the 2012 toolset the _heap_init CRT function does not call the HeapCreate API, but instead it uses GetProcessHeap() to get the process heap. And in this case VLD never sets the VLD_HEAP_CRT_DBG flag and outputs the CRT leaks. So somehow VLD would need to better distinguish which heap or call is coming from the CRT. I am using VLD v2.3.0. Also I believe this is a duplicate of https://vld.codeplex.com/workitem/10421
<p>Compile option /MTd.</p>
<p>Memory leak is reported with the next code.</p>
<p> </p>
<p>int _tmain(int argc, _TCHAR* argv[])</p>
<p>{</p>
<p> return 0;</p>
<p>}</p>
<p> </p>
<p>VisualLeakDetector::_HeapCreate() dose not seem to be called...</p>
<p> </p>
<p>*I use machine translation, I cannot express it well.</p>
Comments: I have managed to slightly debug the root cause of this problem with Visual Studio 2012 and Windows 7. It reproduces with Visual Studio 2012 (v110) platform toolset and Multi-threaded Debug (/MTd) option only (static CRT). It works (ie. no CRT leaks in the output) when setting either Multi-threaded Debug DLL (/MDd) option or Visual Studio 2010 (v100) platform toolset. When comparing what is happening inside vld code I can see that with the 2010 platform toolset VLD is setting the VLD_HEAP_CRT_DBG flag in _HeapCreate function because it is called from the _heap_init CRT function. This function calls HeapCreate which is captured by VLD. With the 2012 toolset the _heap_init CRT function does not call the HeapCreate API, but instead it uses GetProcessHeap() to get the process heap. And in this case VLD never sets the VLD_HEAP_CRT_DBG flag and outputs the CRT leaks. So somehow VLD would need to better distinguish which heap or call is coming from the CRT. I am using VLD v2.3.0. Also I believe this is a duplicate of https://vld.codeplex.com/workitem/10421