KindDragon / vld

Visual Leak Detector for Visual C++ 2008-2015
https://kinddragon.github.io/vld/
GNU Lesser General Public License v2.1
1.02k stars 314 forks source link

False positives detected for static member std::string #72

Open DougRogers opened 4 years ago

DougRogers commented 4 years ago

I have a class that defines a static member: class RawDecoder { public: static std::string cam_profile; }; declared as std::string RawDecoder::cam_profile; which is reported as a leak CRT Alloc ID: 195 Leak Hash: 0x46AD681D, Count: 1, Total 16 bytes Call Stack (TID 5096): ucrtbased.dll!malloc() d:\agent\_work\5\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): Phot.exe!operator new() + 0xA bytes C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xmemory (52): Phot.exe!std::_Default_allocate_traits::_Allocate() C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xmemory (180): Phot.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0xA bytes C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xmemory (785): Phot.exe!std::allocator<std::_Container_proxy>::allocate() C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xmemory (1098): Phot.exe!std::_Container_base12::_Alloc_proxy<std::allocator<std::_Container_proxy> >() + 0xF bytes C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xstring (2286): Phot.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >() + 0x30 bytes C:\Users\drogers\Documents\Visual Studio 2010\Projects\ImageViewers\dcraw\dcraw.cpp (116): Phot.exe!dynamic initializer for 'RawDecoder::cam_profile''() + 0x10 bytes `