1

在使用 Visual Leak Detector 在 Visual Studio 10.0 上执行我的 Visual C++ 程序时,我在输出屏幕上得到以下结果:

{359} normal block at 0x00000000012FFF30, 16 bytes long
 Data: <                > D8 0F 94 E4 F7 07 00 00 00 00 00 00 00 00 00 00 

这是输出的行之一。如果 some1 可以请告诉我如何分析这个或 e1 这意味着什么,这将有很大的帮助。此外,在泄漏开始时,我也得到了这些行:

 Call Stack:
    c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory (36): Dual OS.exe!std::_Allocate<std::_Container_proxy> + 0x22 bytes
    c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory (188): Dual OS.exe!std::allocator<std::_Container_proxy>::allocate
    c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring (469): Dual OS.exe!std::_String_val<char,std::allocator<char> >::_String_val<char,std::allocator<char> > + 0xF bytes
    c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring (550): Dual OS.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > + 0x33 bytes
    c:\users\parthkumars\desktop\dualos\duos\duosdlg.cpp (385): Dual OS.exe!CDUOSDlg::CDUOSDlg + 0xA2 bytes
    c:\users\parthkumars\desktop\dualos\duos\duos.cpp (39): Dual OS.exe!`dynamic initializer for 'dlg'' + 0x12 bytes
    0x0000000014510E94 (File and line number not available): (Module name unavailable)!(Function name unavailable)
  Data:
    D0 0C 94 E4    F7 07 00 00    00 00 00 00    00 00 00 00     ........ ........


---------- Block 2 at 0x00000000012FFA40: 16 bytes ----------
  Call Stack:
    c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory (36): Dual OS.exe!std::_Allocate<std::_Container_proxy> + 0x22 bytes
    c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory (188): Dual OS.exe!std::allocator<std::_Container_proxy>::allocate
    c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector (442): Dual OS.exe!std::_Vector_val<std::pair<unsigned long,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<unsigned long,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > >::_Vector_val<std::pair<unsign + 0xF bytes
    c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector (507): Dual OS.exe!std::vector<std::pair<unsigned long,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<unsigned long,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > >::vector<std::pair<unsigned long,st + 0x33 bytes
    c:\users\parthkumars\desktop\dualos\duos\eventdispatcher.h (19): Dual OS.exe!CEventDispatcher::CEventDispatcher + 0x3D bytes
    c:\users\parthkumars\desktop\dualos\duos\duosdlg.cpp (385): Dual OS.exe!CDUOSDlg::CDUOSDlg + 0x149 bytes
    c:\users\parthkumars\desktop\dualos\duos\duos.cpp (39): Dual OS.exe!`dynamic initializer for 'dlg'' + 0x12 bytes
    0x0000000014510E94 (File and line number not available): (Module name unavailable)!(Function name unavailable)
  Data:
    88 0D 94 E4    F7 07 00 00    00 00 00 00    00 00 00 00     ........ ........
4

2 回答 2

0

输出基本上告诉您您的程序分配了一些内存,但在终止之前它没有释放它。

第一个输出告诉您内存中包含多少数据和哪些数据。

调用堆栈告诉您内存分配的位置。

于 2013-09-05T05:58:33.903 回答
0

看看 CEventDispatcher 构造函数,你应该找到一个新的 std::vector 对,现在有 delete (放置它的正确位置可以是 dtor)

对我来说,该报告中重要的是调用堆栈,它显示分配点,以后如果您掌握调试器,您将能够使用函数地址和偏移量!

于 2013-09-05T06:43:21.903 回答