求助:VLD检测内存泄漏时定位不到自己的代码

FoxBryant 2013-07-19 07:51:56
MFC程序,用最新的Visual Leak Detector (VLD) V2.2.3 检测内存泄漏,可以检测到有内存泄漏的地方,但是调用堆栈中全是系统的函数调用,没有显示在我代码的哪个文件/函数/行号等信息,如下:

---------- Block 5232 at 0x030C0328: 8 bytes ----------
Call Stack:
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory (36): MFCTest.exe!std::_Allocate<std::_Container_proxy> + 0x15 bytes
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory (187): MFCTest.exe!std::allocator<std::_Container_proxy>::allocate + 0xB bytes
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring (469): MFCTest.exe!std::_String_val<wchar_t,std::allocator<wchar_t> >::_String_val<wchar_t,std::allocator<wchar_t> > + 0xA bytes
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring (543): MFCTest.exe!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > + 0x5F bytes
c:\program files (x86)\microsoft visual studio 10.0\vc\include\utility (163): MFCTest.exe!std::_Pair_base<CStdStr<wchar_t> const ,CStdStr<wchar_t> >::_Pair_base<CStdStr<wchar_t> const ,CStdStr<wchar_t> ><CStdStr<wchar_t> const &,CStdStr<wchar_t> &> + 0x76 bytes
c:\program files (x86)\microsoft visual studio 10.0\vc\include\utility (195): MFCTest.exe!std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> >::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> ><CStdStr<wchar_t> const ,CStdStr<wchar_t> > + 0x55 bytes
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory (208): MFCTest.exe!std::allocator<std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> > >::construct<std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> > &> + 0x3C bytes
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory (281): MFCTest.exe!std::_Cons_val<std::allocator<std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> > >,std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> >,std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> > &>
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree (592): MFCTest.exe!std::_Tree_val<std::_Tmap_traits<CStdStr<wchar_t>,CStdStr<wchar_t>,std::less<CStdStr<wchar_t> >,std::allocator<std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> > >,0> >::_Buynode<std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> > &> + 0x2F bytes
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree (1521): MFCTest.exe!std::_Tree<std::_Tmap_traits<CStdStr<wchar_t>,CStdStr<wchar_t>,std::less<CStdStr<wchar_t> >,std::allocator<std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> > >,0> >::_Copy + 0x15 bytes
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree (1501): MFCTest.exe!std::_Tree<std::_Tmap_traits<CStdStr<wchar_t>,CStdStr<wchar_t>,std::less<CStdStr<wchar_t> >,std::allocator<std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> > >,0> >::_Copy + 0x1A bytes
c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree (802): MFCTest.exe!std::_Tree<std::_Tmap_traits<CStdStr<wchar_t>,CStdStr<wchar_t>,std::less<CStdStr<wchar_t> >,std::allocator<std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> > >,0> >::operator=
c:\program files (x86)\microsoft visual studio 10.0\vc\include\map (150): MFCTest.exe!std::map<CStdStr<wchar_t>,CStdStr<wchar_t>,std::less<CStdStr<wchar_t> >,std::allocator<std::pair<CStdStr<wchar_t> const ,CStdStr<wchar_t> > > >::operator=
0x76773677 (File and line number not available): kernel32.dll!BaseThreadInitThunk + 0x12 bytes
0x77669F42 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x63 bytes
0x77669F15 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x36 bytes

请问如何查看泄漏是对应到我自己代码的哪个地方呢?
...全文
4705 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
这不是鸭头 2013-09-23
  • 打赏
  • 举报
回复
CString ReleaseBuffer() ??
china_jeffery 2013-09-20
  • 打赏
  • 举报
回复
你用了std::map了,查看map那里有没有错

2,586

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 资源
社区管理员
  • 资源
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧