Plug a memory leak on Windows