Code changes to plug memory leak after switch the Windows 64-bit