Quantcast
Channel: Visual Leak Detector for Visual C++ 2008-2015
Viewing all articles
Browse latest Browse all 704

New Post: VLD locks main thread while unloading DLL

$
0
0
Hi guys,

I used VLD in the library, which is dynamically loaded and unloaded from process.
What is happening when library is unloaded by calling UnloadLIbrary()?

I have an impression that it locks main thread for a while, because when unloads library, the method VisualLeakDetector::waitForAllVLDThreads() is called from destructor of g_vld object. Then I'm getting application crash caused by VLD, because m_heapMapLock object does not exist anymore. Here is call stack during crash:

vld.dll!CriticalSectionLocker::CriticalSectionLocker(CriticalSection & cs) Line 54
vld.dll!VisualLeakDetector::unmapBlock(void * heap, const void * mem, const context_t & context) Line 1122
vld.dll!VisualLeakDetector::_HeapFree(void * heap, unsigned long flags, void * mem) Line 1637
dbghelp.dll!0edacd40()
dbghelp.dll!0edae7da()
........

Is there any suggestion how to avoid this crash having VLD only in the library, which is dynamically loaded / unloaded?
Thanks.

Viewing all articles
Browse latest Browse all 704

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>