KindDragon / vld

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

False positive report with thread_local #73

Open Balenty opened 4 years ago

Balenty commented 4 years ago

Using: Windows Visual Studio 2019 VLD 2.5.1

When i am having thread_local variabel in a global namespace stored they are constructed on thread creation and deconstructed at thread destroy.

Apparently the VLD-thread of BOOLEAN WINAPI LdrpCallInitRoutine is also constructing these thread_local variable but not deconstructing before reporting memory leaks.

So the VLD-created thread_local variables are reported being a leak.

As workaround leaks from the same ThreadID as the VLD Thread might be filtered out.