 <p>Similar to Charlie Martin, you can do something like this:</p> <pre><code>static unigned __int64 _foo_id = 0; foo::foo() { ++_foo_id; if (_foo_id == MAGIC_BAD_ALLOC_ID) DebugBreak(); std::werr &lt;&lt; L"foo::foo @ " &lt;&lt; _foo_id &lt;&lt; std::endl; } foo::~foo() { --_foo_id; std::werr &lt;&lt; L"foo::~foo @ " &lt;&lt; _foo_id &lt;&lt; std::endl; } </code></pre> <p>If you can recreate it, even once or twice with the same allocation id, this will let you look at what is happening right then and there (obviously TLS/threading has to be handled as well, if needed, but I left it out for clarity).</p>