Visual Leak Detector seems to detect leaks in code simply upon creating a Win32Thread and then quitting. The following code:
---------- Block 9160 at 0x000000009AE8AEE0: 64 bytes ----------
Leak Hash: 0xC0D7A6B5, Count: 1, Total 64 bytes
Call Stack (TID 3520):
ucrtbased.dll!malloc()
d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): my-app.exe!operator new() + 0xA bytes
c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\xmemory0 (53): my-app.exe!std::_Default_allocate_traits::_Allocate()
c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\xmemory0 (190): my-app.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0xA bytes
my-app.exe!std::allocator<std::_Tree_node<std::pair<rtc::Thread * __ptr64 const,std::set<rtc::Thread * __ptr64,std::less<rtc::Thread * __ptr64>,std::allocator<rtc::Thread * __ptr64> > >,void * __ptr64> >::allocate() + 0x20 bytes
my-app.exe!std::_Tree_comp_alloc<std::_Tmap_traits<rtc::Thread * __ptr64,std::set<rtc::Thread * __ptr64,std::less<rtc::Thread * __ptr64>,std::allocator<rtc::Thread * __ptr64> >,std::less<rtc::Thread * __ptr64>,std::allocator<std::pair<rtc::Thread * __ptr64 const,std() + 0x27 bytes
my-app.exe!std::_Tree_comp_alloc<std::_Tmap_traits<rtc::Thread * __ptr64,std::set<rtc::Thread * __ptr64,std::less<rtc::Thread * __ptr64>,std::allocator<rtc::Thread * __ptr64> >,std::less<rtc::Thread * __ptr64>,std::allocator<std::pair<rtc::Thread * __ptr64 const,std() + 0x22 bytes
my-app.exe!std::_Tree_comp_alloc<std::_Tmap_traits<rtc::Thread * __ptr64,std::set<rtc::Thread * __ptr64,std::less<rtc::Thread * __ptr64>,std::allocator<rtc::Thread * __ptr64> >,std::less<rtc::Thread * __ptr64>,std::allocator<std::pair<rtc::Thread * __ptr64 const,std() + 0x34 bytes
my-app.exe!std::_Tree<std::_Tmap_traits<rtc::Thread * __ptr64,std::set<rtc::Thread * __ptr64,std::less<rtc::Thread * __ptr64>,std::allocator<rtc::Thread * __ptr64> >,std::less<rtc::Thread * __ptr64>,std::allocator<std::pair<rtc::Thread * __ptr64 const,std::set<rtc::() + 0x1D bytes
my-app.exe!std::map<rtc::Thread * __ptr64,std::set<rtc::Thread * __ptr64,std::less<rtc::Thread * __ptr64>,std::allocator<rtc::Thread * __ptr64> >,std::less<rtc::Thread * __ptr64>,std::allocator<std::pair<rtc::Thread * __ptr64 const,std::set<rtc::Thread * __ptr64,std() + 0x18 bytes
my-app.exe!rtc::ThreadManager::ThreadManager() + 0x45 bytes
my-app.exe!rtc::ThreadManager::Instance() + 0x5F bytes
my-app.exe!rtc::ThreadManager::Add() + 0xE bytes
my-app.exe!rtc::Thread::DoInit() + 0x31 bytes
my-app.exe!rtc::Thread::Thread() + 0x282 bytes
my-app.exe!rtc::Thread::Thread() + 0x20 bytes
my-app.exe!rtc::Win32Thread::Win32Thread() + 0x1D bytes
What am I missing? Is there some sort of specific cleanup required that I need to perform?