Work around AngelScript memory leak. Thanks to 299299. Closes #271.