check memory leak when using MSVC