Fixed memory leak, added WIN only memory leak test.