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

Created Unassigned: Waiting for threads to terminate... [10572]

$
0
0
I am developing a COM dll which is CoCreateInstanced by a program.

When vld exits, it calls waitForAllVLDThreads from which WiatForSingleObject is called for each thread in m_tlsMap. In normal cases, it returns WAIT_OBJECT_0.

However, if that program is also injected with an external dll for logging purpose,
WaitForSingleObject always returns WAIT_TIMEOUT.
vld tries it for at most 9 threads (for 90 seconds) before returning from waitForAllVLDThreads.

//--------------------------------
[log from Output window]
//--------------------------------
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
Visual Leak Detector: Waiting for threads to terminate...
No memory leaks detected.
WARNING: Visual Leak Detector: Some threads appear to have not terminated normally.
This could cause inaccurate leak detection results, including false positives.
Visual Leak Detector is now exiting.
//--------------------------------

There are two cases depening on the availability of the external dll's source code.

[case 1] external dll's source available
Adding the following line into the external dll's source file will solve this issue. I don't know why, though.
#include <vld.h>

But, isn't there any way to avoid this issue without adding vld.h to the external dll's source file?

[case 2] external dll's source not available
How can this issue be resolved?





Viewing all articles
Browse latest Browse all 704

Trending Articles



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