• 注册
欢迎加入behaviac Q&A网站。behaviac是腾讯开源组件https://github.com/TencentOpen/behaviac 官方网站:http://www.behaviac.com/,提供各种文档和教程及手册 为了您及时的获得您最新问题的评论或者回答,请提供并验证您的邮箱

很多内存泄漏

0 喜欢 0 不喜欢
278 浏览

vs2015下用vld检测出behaviac有很多的内存泄漏

最新提问 6月 22, 2016 用户: qq_576a6ff985d68 (170 分)
重新显示 7月 4, 2016 用户:jonygli

1个回答

0 喜欢 0 不喜欢
麻烦提供更多的详情?
最新回答 6月 22, 2016 用户: jonygli (58,290 分)
vs2015 cocos2d-x 3.11

项目中就只加了

    behaviac::Config::SetSocketBlocking(false);
    behaviac::Config::SetSocketPort(8081); 这两句

退出的时候出现

WARNING: Visual Leak Detector detected memory leaks!
---------- Block 6 at 0x04CA3040: 524323 bytes ----------
  Leak Hash: 0xAFA3C31B, Count: 1, Total 524323 bytes
  Call Stack (TID 3164):
    ucrtbased.dll!aligned_malloc()
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (232): test.exe!behaviac::MemDefaultAllocator::AllocAligned() + 0x10 bytes
    e:\game\test\test\external\behaviac\inc\behaviac\base\core\memory\mempool.h (582): test.exe!behaviac::BasicObjectPool<hash_exmemory<unsigned int,1024>::HashItem,behaviac::IMemAllocator,behaviac::Mutex>::AllocateSegment() + 0x27 bytes
    e:\game\test\test\external\behaviac\inc\behaviac\base\core\memory\mempool.h (416): test.exe!behaviac::BasicObjectPool<hash_exmemory<unsigned int,1024>::HashItem,behaviac::IMemAllocator,behaviac::Mutex>::AllocateInternal() + 0x8 bytes
    e:\game\test\test\external\behaviac\inc\behaviac\base\core\memory\mempool.h (387): test.exe!behaviac::BasicObjectPool<hash_exmemory<unsigned int,1024>::HashItem,behaviac::IMemAllocator,behaviac::Mutex>::Allocate() + 0x13 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (453): test.exe!behaviac::PtrSizeRegister_::RegisterPtrSize() + 0xE bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (260): test.exe!behaviac::MemDefaultAllocator::AllocAligned() + 0x2B bytes
    e:\game\test\test\external\behaviac\inc\behaviac\base\core\memory\stl_allocator.h (82): test.exe!behaviac::stl_allocator<std::_Container_proxy>::allocate() + 0x30 bytes
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 (875): test.exe!std::_Wrap_alloc<behaviac::stl_allocator<std::_Container_proxy> >::allocate()
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (643): test.exe!std::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >::_Alloc_proxy() + 0xA bytes
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (603): test.exe!std::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >()
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (787): test.exe!std::basic_string<char,std::char_traits<char>,behaviac::stl_allocator<char> >::basic_string<char,std::char_traits<char>,behaviac::stl_allocator<char> >() + 0x8 bytes
    e:\game\test\test\external\behaviac\src\base\core\socket\socketconnect_base.cpp (239): test.exe!behaviac::ConnectorInterface::ConnectorInterface() + 0x1D bytes
    e:\game\test\test\external\behaviac\src\base\socket\socketconnect.cpp (123): test.exe!behaviac::ConnectorImpl::ConnectorImpl() + 0x2B bytes
    e:\game\test\test\external\behaviac\src\base\socket\socketconnect.cpp (120): test.exe!behaviac::`dynamic initializer for 's_tracer''() + 0x28 bytes
    ucrtbased.dll!initterm() + 0x49 bytes
    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (221): test.exe!__scrt_common_main_seh() + 0xF bytes
    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (300): test.exe!__scrt_common_main()
    f:\dd\vctools\crt\vcstartup\src\startup\exe_wwinmain.cpp (17): test.exe!wWinMainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x24 bytes
    ntdll.dll!RtlUnicodeStringToInteger() + 0x253 bytes
    ntdll.dll!RtlUnicodeStringToInteger() + 0x21E bytes
  Data:
    40 30 CA 04    ED ED ED ED    00 00 00 00    00 00 00 00     @0...... ........
    0B 0B BA BE    48 30 D2 04    00 40 00 00    CD CD CD CD     ....H0.. .@......
    DE AD D0 01    00 00 00 00    00 00 00 00    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    DE AD D0 01    01 00 00 00    68 30 CA 04    CD CD CD CD     ........ h0......
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    DE AD D0 01    02 00 00 00    88 30 CA 04    CD CD CD CD     ........ .0......
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    DE AD D0 01    03 00 00 00    A8 30 CA 04    CD CD CD CD     ........ .0......
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    DE AD D0 01    04 00 00 00    C8 30 CA 04    CD CD CD CD     ........ .0......
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    DE AD D0 01    05 00 00 00    E8 30 CA 04    CD CD CD CD     ........ .0......
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    DE AD D0 01    06 00 00 00    08 31 CA 04    CD CD CD CD     ........ .1......
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
---------- Block 2 at 0x04F56000: 6456 bytes ----------
  Leak Hash: 0x59DDCD53, Count: 1, Total 6456 bytes
  Call Stack (TID 3164):
    ucrtbased.dll!malloc()
    f:\dd\vctools\crt\vcstartup\src\heap\new_scalar.cpp (19): test.exe!operator new() + 0x9 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (33): test.exe!behaviac::GetThreadInt() + 0xA bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (94): test.exe!behaviac::MemDefaultAllocator::MemDefaultAllocator() + 0x5 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (354): test.exe!behaviac::GetDefaultMemoryAllocator() + 0x2B bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memory.cpp (29): test.exe!behaviac::GetMemoryAllocator()
    e:\game\test\test\external\behaviac\inc\behaviac\base\core\memory\stl_allocator.h (82): test.exe!behaviac::stl_allocator<std::_Container_proxy>::allocate() + 0x5 bytes
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 (875): test.exe!std::_Wrap_alloc<behaviac::stl_allocator<std::_Container_proxy> >::allocate()
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (643): test.exe!std::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >::_Alloc_proxy() + 0xA bytes
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (603): test.exe!std::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >()
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (787): test.exe!std::basic_string<char,std::char_traits<char>,behaviac::stl_allocator<char> >::basic_string<char,std::char_traits<char>,behaviac::stl_allocator<char> >() + 0x8 bytes
    e:\game\test\test\external\behaviac\src\base\core\socket\socketconnect_base.cpp (239): test.exe!behaviac::ConnectorInterface::ConnectorInterface() + 0x1D bytes
    e:\game\test\test\external\behaviac\src\base\socket\socketconnect.cpp (123): test.exe!behaviac::ConnectorImpl::ConnectorImpl() + 0x2B bytes
    e:\game\test\test\external\behaviac\src\base\socket\socketconnect.cpp (120): test.exe!behaviac::`dynamic initializer for 's_tracer''() + 0x28 bytes
    ucrtbased.dll!initterm() + 0x49 bytes
    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (221): test.exe!__scrt_common_main_seh() + 0xF bytes
    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (300): test.exe!__scrt_common_main()
    f:\dd\vctools\crt\vcstartup\src\startup\exe_wwinmain.cpp (17): test.exe!wWinMainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x24 bytes
    ntdll.dll!RtlUnicodeStringToInteger() + 0x253 bytes
    ntdll.dll!RtlUnicodeStringToInteger() + 0x21E bytes
  Data:
    01 00 00 00    01 00 00 00    5C 0C 00 00    00 00 00 00     ........ \.......
    00 00 00 00    02 00 00 00    CD CD CD CD    00 00 00 00     ........ ........
    03 00 00 00    CD CD CD CD    00 00 00 00    04 00 00 00     ........ ........
    CD CD CD CD    00 00 00 00    05 00 00 00    CD CD CD CD     ........ ........
    00 00 00 00    06 00 00 00    CD CD CD CD    00 00 00 00     ........ ........
    07 00 00 00    CD CD CD CD    00 00 00 00    08 00 00 00     ........ ........
    CD CD CD CD    00 00 00 00    09 00 00 00    CD CD CD CD     ........ ........
    00 00 00 00    0A 00 00 00    CD CD CD CD    00 00 00 00     ........ ........
    0B 00 00 00    CD CD CD CD    00 00 00 00    0C 00 00 00     ........ ........
    CD CD CD CD    00 00 00 00    0D 00 00 00    CD CD CD CD     ........ ........
    00 00 00 00    0E 00 00 00    CD CD CD CD    00 00 00 00     ........ ........
    0F 00 00 00    CD CD CD CD    00 00 00 00    10 00 00 00     ........ ........
    CD CD CD CD    00 00 00 00    11 00 00 00    CD CD CD CD     ........ ........
    00 00 00 00    12 00 00 00    CD CD CD CD    00 00 00 00     ........ ........
    13 00 00 00    CD CD CD CD    00 00 00 00    14 00 00 00     ........ ........
    CD CD CD CD    00 00 00 00    15 00 00 00    CD CD CD CD     ........ ........
---------- Block 3 at 0x04F57968: 4256 bytes ----------
  Leak Hash: 0x76650E92, Count: 1, Total 4256 bytes
  Call Stack (TID 3164):
    ucrtbased.dll!malloc()
    f:\dd\vctools\crt\vcstartup\src\heap\new_scalar.cpp (19): test.exe!operator new() + 0x9 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (408): test.exe!behaviac::PtrSizeRegister::Create() + 0xA bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (98): test.exe!behaviac::MemDefaultAllocator::MemDefaultAllocator() + 0x5 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (354): test.exe!behaviac::GetDefaultMemoryAllocator() + 0x2B bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memory.cpp (29): test.exe!behaviac::GetMemoryAllocator()
    e:\game\test\test\external\behaviac\inc\behaviac\base\core\memory\stl_allocator.h (82): test.exe!behaviac::stl_allocator<std::_Container_proxy>::allocate() + 0x5 bytes
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 (875): test.exe!std::_Wrap_alloc<behaviac::stl_allocator<std::_Container_proxy> >::allocate()
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (643): test.exe!std::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >::_Alloc_proxy() + 0xA bytes
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (603): test.exe!std::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >()
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (787): test.exe!std::basic_string<char,std::char_traits<char>,behaviac::stl_allocator<char> >::basic_string<char,std::char_traits<char>,behaviac::stl_allocator<char> >() + 0x8 bytes
    e:\game\test\test\external\behaviac\src\base\core\socket\socketconnect_base.cpp (239): test.exe!behaviac::ConnectorInterface::ConnectorInterface() + 0x1D bytes
    e:\game\test\test\external\behaviac\src\base\socket\socketconnect.cpp (123): test.exe!behaviac::ConnectorImpl::ConnectorImpl() + 0x2B bytes
    e:\game\test\test\external\behaviac\src\base\socket\socketconnect.cpp (120): test.exe!behaviac::`dynamic initializer for 's_tracer''() + 0x28 bytes
    ucrtbased.dll!initterm() + 0x49 bytes
    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (221): test.exe!__scrt_common_main_seh() + 0xF bytes
    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (300): test.exe!__scrt_common_main()
    f:\dd\vctools\crt\vcstartup\src\startup\exe_wwinmain.cpp (17): test.exe!wWinMainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x24 bytes
    ntdll.dll!RtlUnicodeStringToInteger() + 0x253 bytes
    ntdll.dll!RtlUnicodeStringToInteger() + 0x21E bytes
  Data:
    54 30 73 00    00 00 00 00    00 00 00 00    00 00 00 00     T0s..... ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
---------- Block 4 at 0x05111878: 12 bytes ----------
  Leak Hash: 0x65C3D792, Count: 1, Total 12 bytes
  Call Stack (TID 3164):
    ucrtbased.dll!malloc()
    f:\dd\vctools\crt\vcstartup\src\heap\new_scalar.cpp (19): test.exe!operator new() + 0x9 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (354): test.exe!behaviac::GetDefaultMemoryAllocator() + 0x7 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memory.cpp (29): test.exe!behaviac::GetMemoryAllocator()
    e:\game\test\test\external\behaviac\inc\behaviac\base\core\memory\mempool.h (261): test.exe!behaviac::BasicObjectPool<hash_exmemory<unsigned int,1024>::HashItem,behaviac::IMemAllocator,behaviac::Mutex>::BasicObjectPool<hash_exmemory<unsigned int,1024>::HashItem,behaviac::IMemAllocator,behaviac::Mutex>() + 0x5 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (377): test.exe!behaviac::PtrSizePool::PtrSizePool()
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (436): test.exe!behaviac::PtrSizeRegister_::PtrSizeRegister_() + 0x13 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (408): test.exe!behaviac::PtrSizeRegister::Create() + 0x2E bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (98): test.exe!behaviac::MemDefaultAllocator::MemDefaultAllocator() + 0x5 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (354): test.exe!behaviac::GetDefaultMemoryAllocator() + 0x2B bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memory.cpp (29): test.exe!behaviac::GetMemoryAllocator()
    e:\game\test\test\external\behaviac\inc\behaviac\base\core\memory\stl_allocator.h (82): test.exe!behaviac::stl_allocator<std::_Container_proxy>::allocate() + 0x5 bytes
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 (875): test.exe!std::_Wrap_alloc<behaviac::stl_allocator<std::_Container_proxy> >::allocate()
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (643): test.exe!std::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >::_Alloc_proxy() + 0xA bytes
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (603): test.exe!std::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >()
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (787): test.exe!std::basic_string<char,std::char_traits<char>,behaviac::stl_allocator<char> >::basic_string<char,std::char_traits<char>,behaviac::stl_allocator<char> >() + 0x8 bytes
    e:\game\test\test\external\behaviac\src\base\core\socket\socketconnect_base.cpp (239): test.exe!behaviac::ConnectorInterface::ConnectorInterface() + 0x1D bytes
    e:\game\test\test\external\behaviac\src\base\socket\socketconnect.cpp (123): test.exe!behaviac::ConnectorImpl::ConnectorImpl() + 0x2B bytes
    e:\game\test\test\external\behaviac\src\base\socket\socketconnect.cpp (120): test.exe!behaviac::`dynamic initializer for 's_tracer''() + 0x28 bytes
    ucrtbased.dll!initterm() + 0x49 bytes
    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (221): test.exe!__scrt_common_main_seh() + 0xF bytes
    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (300): test.exe!__scrt_common_main()
    f:\dd\vctools\crt\vcstartup\src\startup\exe_wwinmain.cpp (17): test.exe!wWinMainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x24 bytes
    ntdll.dll!RtlUnicodeStringToInteger() + 0x253 bytes
    ntdll.dll!RtlUnicodeStringToInteger() + 0x21E bytes
  Data:
    28 2F 73 00    01 CD CD CD    00 00 00 00                    (/s..... ........

---------- Block 1 at 0x05111C30: 12 bytes ----------
  Leak Hash: 0xE204DD88, Count: 1, Total 12 bytes
  Call Stack (TID 3164):
    ucrtbased.dll!malloc()
    f:\dd\vctools\crt\vcstartup\src\heap\new_scalar.cpp (19): test.exe!operator new() + 0x9 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memalloc.cpp (354): test.exe!behaviac::GetDefaultMemoryAllocator() + 0x7 bytes
    e:\game\test\test\external\behaviac\src\base\core\memory\memory.cpp (29): test.exe!behaviac::GetMemoryAllocator()
    e:\game\test\test\external\behaviac\inc\behaviac\base\core\memory\stl_allocator.h (82): test.exe!behaviac::stl_allocator<std::_Container_proxy>::allocate() + 0x5 bytes
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xmemory0 (875): test.exe!std::_Wrap_alloc<behaviac::stl_allocator<std::_Container_proxy> >::allocate()
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (643): test.exe!std::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >::_Alloc_proxy() + 0xA bytes
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (603): test.exe!std::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >::_String_alloc<std::_String_base_types<char,behaviac::stl_allocator<char> > >()
    d:\program files (x86)\microsoft visual studio 14.0\vc\include\xstring (787): test.exe!std::basic_string<char,std::char_traits<char>,behaviac::stl_allocator<char> >::basic_string<char,std::char_traits<char>,behaviac::stl_allocator<char> >() + 0x8 bytes
    e:\game\test\test\external\behaviac\src\base\core\socket\socketconnect_base.cpp (239): test.exe!behaviac::ConnectorInterface::ConnectorInterface() + 0x1D bytes
    e:\game\test\test\external\behaviac\src\base\socket\socketconnect.cpp (123): test.exe!behaviac::ConnectorImpl::ConnectorImpl() + 0x2B bytes
    e:\game\test\test\external\behaviac\src\base\socket\socketconnect.cpp (120): test.exe!behaviac::`dynamic initializer for 's_tracer''() + 0x28 bytes
    ucrtbased.dll!initterm() + 0x49 bytes
    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (221): test.exe!__scrt_common_main_seh() + 0xF bytes
    f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (300): test.exe!__scrt_common_main()
    f:\dd\vctools\crt\vcstartup\src\startup\exe_wwinmain.cpp (17): test.exe!wWinMainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x24 bytes
    ntdll.dll!RtlUnicodeStringToInteger() + 0x253 bytes
    ntdll.dll!RtlUnicodeStringToInteger() + 0x21E bytes
  Data:
    28 2F 73 00    01 CD CD CD    68 79 F5 04                    (/s..... hy......

Visual Leak Detector detected 5 memory leaks (535239 bytes).
Largest number used: 536894 bytes.
Total allocations: 536982 bytes.
Visual Leak Detector is now exiting.
程序“[11128] test.exe”已退出,返回值为 0 (0x0)。
这是全局变量导致的,并不是严格意义上真的内存泄漏。
...