Add some std::cout logging, to try and diagnose a memory leak.