Fix of the https://github.com/Azure/vld/issues/28 issue.
The Callstack structure is reset inside the CaptureContext destructor and deleted inside the unmap method. CaptureContext destructor and unmap method can be called in separate threads but std::unordered_map restore method is not threadsafe and the call is not protected by the critical section, because of this the Callstack destructor can be called twice for the same object.
Fix of the https://github.com/Azure/vld/issues/28 issue. The
Callstack
structure is reset inside theCaptureContext
destructor and deleted inside theunmap
method.CaptureContext
destructor andunmap
method can be called in separate threads butstd::unordered_map restore
method is not threadsafe and the call is not protected by the critical section, because of this theCallstack
destructor can be called twice for the same object.