Repository: opencv
Issue: Run Static lib had memory leak.
Labels: bug,duplicate,platform: win32,needs investigation

### System Information

OpenCV version: 4.5.5, 4.6.0 and 4.7.0
Operating System / Platform: Windows 10; 64bit
Compiler => Visual Studio 2019: v142 C++

### Detailed description

Build with opencv x64 DEBUG without BUILD_WITH_STATIC_CRT and BUILD_SHARED_LIBS.
Select the BUILD_opencv_world.

Create a new project with C++ console App and import include, static lib.
Using vld.h to check memory leak.

It's seem that something in cv::utils::logging not release with using static lib.

 
I fetched some error at bellow.
```
Leak Hash: 0x86DC3316, Count: 1, Total 16 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!std::_Default_allocate_traits::_Allocate() + 0x14 bytes
    ConsoleApplication2.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0x33 bytes
    ConsoleApplication2.exe!std::allocator<std::_Container_proxy>::allocate() + 0x21 bytes
    ConsoleApplication2.exe!std::_Container_base12::_Alloc_proxy<std::allocator<std::_Container_proxy> >() + 0x1E bytes
    ConsoleApplication2.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >() + 0x41 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagConfig::LogTagConfig() + 0x17 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagConfigParser::LogTagConfigParser() + 0x2D bytes
    ConsoleApplication2.exe!std::_Construct_in_place<cv::utils::logging::LogTagConfigParser,enum cv::utils::logging::LogLevel & __ptr64>() + 0x49 bytes
    ConsoleApplication2.exe!std::_Ref_count_obj2<cv::utils::logging::LogTagConfigParser>::_Ref_count_obj2<cv::utils::logging::LogTagConfigParser><enum cv::utils::logging::LogLevel & __ptr64>() + 0x52 bytes
    ConsoleApplication2.exe!std::make_shared<cv::utils::logging::LogTagConfigParser,enum cv::utils::logging::LogLevel & __ptr64>() + 0x64 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::LogTagManager() + 0xC5 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitStruct::GlobalLoggingInitStruct() + 0x1D bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::getGlobalLogTag() + 0x141 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitCall::GlobalLoggingInitCall() + 0xF bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBEC2 bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    38 CE FA 25    A3 01 00 00    00 00 00 00    00 00 00 00     8..%.... ........


---------- Block 14 at 0x0000000026033EE0: 16 bytes ----------
  Leak Hash: 0x9D9208AA, Count: 1, Total 16 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!std::_Default_allocate_traits::_Allocate() + 0x14 bytes
    ConsoleApplication2.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0x33 bytes
    ConsoleApplication2.exe!std::allocator<std::_Container_proxy>::allocate() + 0x21 bytes
    ConsoleApplication2.exe!std::_Container_base12::_Alloc_proxy<std::allocator<std::_Container_proxy> >() + 0x1E bytes
    ConsoleApplication2.exe!std::vector<cv::details::ThreadData * __ptr64,std::allocator<cv::details::ThreadData * __ptr64> >::vector<cv::details::ThreadData * __ptr64,std::allocator<cv::details::ThreadData * __ptr64> >() + 0x40 bytes
    ConsoleApplication2.exe!cv::details::TlsStorage::TlsStorage() + 0x48 bytes
    ConsoleApplication2.exe!cv::getTimestampNS() + 0x1D1 bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBC9B bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    58 BE FA 25    A3 01 00 00    00 00 00 00    00 00 00 00     X..%.... ........


---------- Block 107 at 0x0000000026033F80: 8 bytes ----------
Leak Hash: 0x5032FC18, Count: 1, Total 8 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!cv::Mat::getStdAllocator() + 0x4A bytes
    ConsoleApplication2.exe!cv::Mat::getDefaultAllocator() + 0x65 bytes
    ConsoleApplication2.exe!cv::Mat::getDefaultAllocator() + 0xB bytes
    ConsoleApplication2.exe!cv::Mat::create() + 0x347 bytes
    ConsoleApplication2.exe!cv::Mat::create() + 0xA9 bytes
    ConsoleApplication2.exe!cv::Mat::create() + 0x2C bytes
    ConsoleApplication2.exe!cv::MatOp_Initializer::assign() + 0x95 bytes
    D:\3560-SW4\opencv4.6.0\build_static_x64_full\install\include\opencv2\core\mat.inl.hpp (3079): ConsoleApplication2.exe!cv::MatExpr::operator cv::Mat()
    C:\Users\buildsw4\Desktop\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.cpp (8): ConsoleApplication2.exe!main() + 0x50 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (79): ConsoleApplication2.exe!invoke_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (288): ConsoleApplication2.exe!__scrt_common_main_seh() + 0x5 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    58 27 84 A8    F7 7F 00 00                                   X'...... ........


---------- Block 42 at 0x0000000026034070: 16 bytes ----------
  Leak Hash: 0x2C686084, Count: 1, Total 16 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!std::_Default_allocate_traits::_Allocate() + 0x14 bytes
    ConsoleApplication2.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0x33 bytes
    ConsoleApplication2.exe!std::allocator<std::_Container_proxy>::allocate() + 0x21 bytes
    ConsoleApplication2.exe!std::_Container_base12::_Alloc_proxy<std::allocator<std::_Container_proxy> >() + 0x1E bytes
    ConsoleApplication2.exe!std::_Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned __int64 const ,std::pair<unsigned __int64,unsigned __int64> > > > > > >::_Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_Lis() + 0x52 bytes
    ConsoleApplication2.exe!std::_Hash<std::_Umap_traits<unsigned __int64,std::pair<unsigned __int64,unsigned __int64>,std::_Uhash_compare<unsigned __int64,std::hash<unsigned __int64>,std::equal_to<unsigned __int64> >,std::allocator<std::pair<unsigned __int64 const ,std::pair<unsign() + 0x53 bytes
    ConsoleApplication2.exe!std::unordered_multimap<unsigned __int64,std::pair<unsigned __int64,unsigned __int64>,std::hash<unsigned __int64>,std::equal_to<unsigned __int64>,std::allocator<std::pair<unsigned __int64 const ,std::pair<unsigned __int64,unsigned __int64> > > >::unordere() + 0x38 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::NameTable::NameTable() + 0x63 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::LogTagManager() + 0xA6 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitStruct::GlobalLoggingInitStruct() + 0x1D bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::getGlobalLogTag() + 0x141 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitCall::GlobalLoggingInitCall() + 0xF bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBEC2 bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    B8 9E 04 26    A3 01 00 00    00 00 00 00    00 00 00 00     ...&.... ........


---------- Block 44 at 0x0000000026034110: 16 bytes ----------
  Leak Hash: 0x59A40D11, Count: 1, Total 16 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!std::_Default_allocate_traits::_Allocate() + 0x14 bytes
    ConsoleApplication2.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0x33 bytes
    ConsoleApplication2.exe!std::allocator<std::_Container_proxy>::allocate() + 0x21 bytes
    ConsoleApplication2.exe!std::_Container_proxy_ptr12<std::allocator<std::_Container_proxy> >::_Container_proxy_ptr12<std::allocator<std::_Container_proxy> >() + 0x3B bytes
    ConsoleApplication2.exe!std::list<std::pair<unsigned __int64 const ,std::pair<unsigned __int64,unsigned __int64> >,std::allocator<std::pair<unsigned __int64 const ,std::pair<unsigned __int64,unsigned __int64> > > >::_Alloc_sentinel_and_proxy() + 0x64 bytes
    ConsoleApplication2.exe!std::list<std::pair<unsigned __int64 const ,std::pair<unsigned __int64,unsigned __int64> >,std::allocator<std::pair<unsigned __int64 const ,std::pair<unsigned __int64,unsigned __int64> > > >::list<std::pair<unsigned __int64 const ,std::pair<unsigned __int() + 0x30 bytes
    ConsoleApplication2.exe!std::_Hash<std::_Umap_traits<unsigned __int64,std::pair<unsigned __int64,unsigned __int64>,std::_Uhash_compare<unsigned __int64,std::hash<unsigned __int64>,std::equal_to<unsigned __int64> >,std::allocator<std::pair<unsigned __int64 const ,std::pair<unsign() + 0x3C bytes
    ConsoleApplication2.exe!std::unordered_multimap<unsigned __int64,std::pair<unsigned __int64,unsigned __int64>,std::hash<unsigned __int64>,std::equal_to<unsigned __int64>,std::allocator<std::pair<unsigned __int64 const ,std::pair<unsigned __int64,unsigned __int64> > > >::unordere() + 0x38 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::NameTable::NameTable() + 0x77 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::LogTagManager() + 0xA6 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitStruct::GlobalLoggingInitStruct() + 0x1D bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::getGlobalLogTag() + 0x141 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitCall::GlobalLoggingInitCall() + 0xF bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBEC2 bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    F0 9E 04 26    A3 01 00 00    00 00 00 00    00 00 00 00     ...&.... ........


---------- Block 69 at 0x0000000026034160: 16 bytes ----------
  Leak Hash: 0x7287DB00, Count: 1, Total 16 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!std::_Default_allocate_traits::_Allocate() + 0x14 bytes
    ConsoleApplication2.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0x33 bytes
    ConsoleApplication2.exe!std::allocator<std::_Container_proxy>::allocate() + 0x21 bytes
    ConsoleApplication2.exe!std::_Container_proxy_ptr12<std::allocator<std::_Container_proxy> >::_Container_proxy_ptr12<std::allocator<std::_Container_proxy> >() + 0x3B bytes
    ConsoleApplication2.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >() + 0x99 bytes
    ConsoleApplication2.exe!std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,unsigned __int64>::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,unsigned __int64><std::basic_string<char,std::char_traits<char>,std::() + 0x26 bytes
    ConsoleApplication2.exe!std::_Default_allocator_traits<std::allocator<std::_List_node<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,unsigned __int64>,void * __ptr64> > >::construct<std::pair<std::basic_string<char,std::char_traits<char>,st() + 0x63 bytes
    ConsoleApplication2.exe!std::_List_node_emplace_op2<std::allocator<std::_List_node<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,unsigned __int64>,void * __ptr64> > >::_List_node_emplace_op2<std::allocator<std::_List_node<std::pair<std::ba() + 0x83 bytes
    ConsoleApplication2.exe!std::_Hash<std::_Umap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,unsigned __int64,std::_Uhash_compare<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::hash<std::basic_string<char,std::char_traits<c() + 0x1A1 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::NameTable::internal_addOrLookupFullName() + 0x169 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::NameTable::addOrLookupFullName() + 0x48 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::assign() + 0xA4 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::LogTagManager() + 0x101 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitStruct::GlobalLoggingInitStruct() + 0x1D bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::getGlobalLogTag() + 0x141 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitCall::GlobalLoggingInitCall() + 0xF bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBEC2 bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    30 D9 FD 25    A3 01 00 00    00 00 00 00    00 00 00 00     0..%.... ........


---------- Block 53 at 0x00000000260341B0: 16 bytes ----------
  Leak Hash: 0xBB47D24E, Count: 1, Total 16 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!std::_Default_allocate_traits::_Allocate() + 0x14 bytes
    ConsoleApplication2.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0x33 bytes
    ConsoleApplication2.exe!std::allocator<std::_Container_proxy>::allocate() + 0x21 bytes
    ConsoleApplication2.exe!std::_Container_base12::_Alloc_proxy<std::allocator<std::_Container_proxy> >() + 0x1E bytes
    ConsoleApplication2.exe!std::vector<cv::utils::logging::LogTagConfig,std::allocator<cv::utils::logging::LogTagConfig> >::vector<cv::utils::logging::LogTagConfig,std::allocator<cv::utils::logging::LogTagConfig> >() + 0x40 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagConfigParser::LogTagConfigParser() + 0x65 bytes
    ConsoleApplication2.exe!std::_Construct_in_place<cv::utils::logging::LogTagConfigParser,enum cv::utils::logging::LogLevel & __ptr64>() + 0x49 bytes
    ConsoleApplication2.exe!std::_Ref_count_obj2<cv::utils::logging::LogTagConfigParser>::_Ref_count_obj2<cv::utils::logging::LogTagConfigParser><enum cv::utils::logging::LogLevel & __ptr64>() + 0x52 bytes
    ConsoleApplication2.exe!std::make_shared<cv::utils::logging::LogTagConfigParser,enum cv::utils::logging::LogLevel & __ptr64>() + 0x64 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::LogTagManager() + 0xC5 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitStruct::GlobalLoggingInitStruct() + 0x1D bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::getGlobalLogTag() + 0x141 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitCall::GlobalLoggingInitCall() + 0xF bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBEC2 bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    A8 CE FA 25    A3 01 00 00    00 00 00 00    00 00 00 00     ...%.... ........


---------- Block 29 at 0x0000000026034430: 16 bytes ----------
  Leak Hash: 0x059E1D50, Count: 1, Total 16 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::LogTagManager() + 0x38 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitStruct::GlobalLoggingInitStruct() + 0x1D bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::getGlobalLogTag() + 0x141 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitCall::GlobalLoggingInitCall() + 0xF bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBEC2 bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    54 ED 96 A8    F7 7F 00 00    04 00 00 00    CD CD CD CD     T....... ........


---------- Block 16 at 0x00000000260368E0: 256 bytes ----------
  Leak Hash: 0x1EAA7E5D, Count: 1, Total 256 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!std::_Default_allocate_traits::_Allocate() + 0x14 bytes
    ConsoleApplication2.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0x33 bytes
    ConsoleApplication2.exe!std::allocator<cv::details::TlsStorage::TlsSlotInfo>::allocate() + 0x21 bytes
    ConsoleApplication2.exe!std::vector<cv::details::TlsStorage::TlsSlotInfo,std::allocator<cv::details::TlsStorage::TlsSlotInfo> >::_Reallocate_exactly() + 0x68 bytes
    ConsoleApplication2.exe!std::vector<cv::details::TlsStorage::TlsSlotInfo,std::allocator<cv::details::TlsStorage::TlsSlotInfo> >::reserve() + 0x45 bytes
    ConsoleApplication2.exe!cv::details::TlsStorage::TlsStorage() + 0x64 bytes
    ConsoleApplication2.exe!cv::getTimestampNS() + 0x1D1 bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBC9B bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    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    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........


---------- Block 3 at 0x00000000260450C0: 80 bytes ----------
  Leak Hash: 0x5EA3AF1A, Count: 1, Total 80 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!cv::getInitializationMutex() + 0x1F bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBC0B bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    02 01 00 00    CD CD CD CD    B8 C8 7F 29    FE 7F 00 00     ........ ...)....
    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    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    FF FF FF FF    00 00 00 00     ........ ........


---------- Block 17 at 0x0000000026049C20: 256 bytes ----------
  Leak Hash: 0x1EE805A0, Count: 1, Total 256 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!std::_Default_allocate_traits::_Allocate() + 0x14 bytes
    ConsoleApplication2.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0x33 bytes
    ConsoleApplication2.exe!std::allocator<cv::details::ThreadData * __ptr64>::allocate() + 0x21 bytes
    ConsoleApplication2.exe!std::vector<cv::details::ThreadData * __ptr64,std::allocator<cv::details::ThreadData * __ptr64> >::_Reallocate_exactly() + 0x68 bytes
    ConsoleApplication2.exe!std::vector<cv::details::ThreadData * __ptr64,std::allocator<cv::details::ThreadData * __ptr64> >::reserve() + 0x45 bytes
    ConsoleApplication2.exe!cv::details::TlsStorage::TlsStorage() + 0x7A bytes
    ConsoleApplication2.exe!cv::getTimestampNS() + 0x1D1 bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBC9B bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........


---------- Block 28 at 0x0000000026049D60: 488 bytes ----------
  Leak Hash: 0x611049D1, Count: 1, Total 488 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::getGlobalLogTag() + 0x12A bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitCall::GlobalLoggingInitCall() + 0xF bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBEC2 bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    02 01 00 00    CD CD CD CD    B8 C8 7F 29    FE 7F 00 00     ........ ...)....
    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    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    CD CD CD CD    CD CD CD CD     ........ ........
    CD CD CD CD    CD CD CD CD    FF FF FF FF    00 00 00 00     ........ ........
    30 44 03 26    A3 01 00 00    A0 38 03 26    A3 01 00 00     0D.&.... .8.&....
    F0 3D 03 26    A3 01 00 00    00 3E 03 26    A3 01 00 00     .=.&.... .>.&....
    00 3E 03 26    A3 01 00 00    80 35 03 26    A3 01 00 00     .>.&.... .5.&....
    50 3D 03 26    A3 01 00 00    58 3D 03 26    A3 01 00 00     P=.&.... X=.&....
    58 3D 03 26    A3 01 00 00    00 00 80 3F    CD CD CD CD     X=.&.... ...?....
    60 37 03 26    A3 01 00 00    20 CD FD 25    A3 01 00 00     `7.&.... ...%....
    01 00 00 00    00 00 00 00    D0 35 03 26    A3 01 00 00     ........ .5.&....
    50 BB FA 25    A3 01 00 00    D0 BB FA 25    A3 01 00 00     P..%.... ...%....
    D0 BB FA 25    A3 01 00 00    07 00 00 00    00 00 00 00     ...%.... ........
    08 00 00 00    00 00 00 00    00 00 80 3F    CD CD CD CD     ........ ...?....
    70 3B 03 26    A3 01 00 00    A0 D2 FD 25    A3 01 00 00     p;.&.... ...%....


---------- Block 80 at 0x000000002604A540: 40 bytes ----------
  Leak Hash: 0x8821CFC8, Count: 1, Total 40 bytes
  Call Stack (TID 22592):
    ucrtbased.dll!malloc()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\heap\new_scalar.cpp (35): ConsoleApplication2.exe!operator new() + 0xA bytes
    ConsoleApplication2.exe!std::_Default_allocate_traits::_Allocate() + 0x14 bytes
    ConsoleApplication2.exe!std::_Allocate<16,std::_Default_allocate_traits,0>() + 0x33 bytes
    ConsoleApplication2.exe!std::allocator<std::_List_node<std::pair<unsigned __int64 const ,std::pair<unsigned __int64,unsigned __int64> >,void * __ptr64> >::allocate() + 0x21 bytes
    ConsoleApplication2.exe!std::_Alloc_construct_ptr<std::allocator<std::_List_node<std::pair<unsigned __int64 const ,std::pair<unsigned __int64,unsigned __int64> >,void * __ptr64> > >::_Allocate() + 0x29 bytes
    ConsoleApplication2.exe!std::_List_node_emplace_op2<std::allocator<std::_List_node<std::pair<unsigned __int64 const ,std::pair<unsigned __int64,unsigned __int64> >,void * __ptr64> > >::_List_node_emplace_op2<std::allocator<std::_List_node<std::pair<unsigned __int64 const ,std::p() + 0x33 bytes
    ConsoleApplication2.exe!std::_Hash<std::_Umap_traits<unsigned __int64,std::pair<unsigned __int64,unsigned __int64>,std::_Uhash_compare<unsigned __int64,std::hash<unsigned __int64>,std::equal_to<unsigned __int64> >,std::allocator<std::pair<unsigned __int64 const ,std::pair<unsign() + 0xAB bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::NameTable::internal_addCrossReference() + 0x104 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::NameTable::addOrLookupFullName() + 0x106 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::assign() + 0xA4 bytes
    ConsoleApplication2.exe!cv::utils::logging::LogTagManager::LogTagManager() + 0x101 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitStruct::GlobalLoggingInitStruct() + 0x1D bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::getGlobalLogTag() + 0x141 bytes
    ConsoleApplication2.exe!cv::utils::logging::internal::GlobalLoggingInitCall::GlobalLoggingInitCall() + 0xF bytes
    ConsoleApplication2.exe!icv_y8_owniSet_32s_C3R_L() + 0xBEC2 bytes
    ucrtbased.dll!initterm() + 0x59 bytes
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (258): ConsoleApplication2.exe!__scrt_common_main_seh()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): ConsoleApplication2.exe!__scrt_common_main()
    D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): ConsoleApplication2.exe!mainCRTStartup()
    KERNEL32.DLL!BaseThreadInitThunk() + 0x14 bytes
    ntdll.dll!RtlUserThreadStart() + 0x21 bytes
  Data:
    B0 68 FB 25    A3 01 00 00    B0 68 FB 25    A3 01 00 00     .h.%.... .h.%....
    00 00 00 00    00 00 00 00    00 00 00 00    00 00 00 00     ........ ........
    00 00 00 00    00 00 00 00                                   ........ ........


Visual Leak Detector detected 46 memory leaks (5228 bytes).
Largest number used: 18723 bytes.
Total allocations: 23347 bytes.
Visual Leak Detector is now exiting.
The program '[9032] ConsoleApplication2.exe' has exited with code 0 (0x0).
```

### Steps to reproduce

```
#include <iostream>
#include <opencv2/opencv.hpp>
#include "vld.h"

int main()
{    
    cv::Mat a = cv::Mat::zeros(32, 100, CV_32F);
            
    std::cout << "Hello World!\n";
}
```

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [ ] There is reproducer code and related data files (videos, images, onnx, etc)