Fix MAGN1423. Cleanup FFI when resetting the VM
Merge pull request #1156 from ke-yu/ChocoButter-2Become1

Fix MAGN1423. Cleanup FFI when resetting the VM