fix memory leak
fix win32 build?