fix vld memory leak and win32 compile