I think, I found something that may cause this behaviour and it looks like it's my own fault:
in vld.cpp, around line 590:
However, I'll try to supply it as a dll.
in vld.cpp, around line 590:
if (!FindImport((HMODULE)modulebase, m_vldBase, VLDDLL, "?g_vld@@3VVisualLeakDetector@@A"))
{
// This module does not import VLD. This means that none of the module's
// sources #included vld.h.
I'm not really sure about it. What happens if VLD doesn't find a module that loads it? I mean that is what happens after directly linking it into my dll.However, I'll try to supply it as a dll.