fixing cherrypicked d530d836
[aot] fixing up cherrypicked of AOT class allocation leak fix