diff --git a/enzyme/Enzyme/Runtimes/FPRT/GarbageCollection.cpp b/enzyme/Enzyme/Runtimes/FPRT/GarbageCollection.cpp index 74c0f82151c..1c9d787d58b 100644 --- a/enzyme/Enzyme/Runtimes/FPRT/GarbageCollection.cpp +++ b/enzyme/Enzyme/Runtimes/FPRT/GarbageCollection.cpp @@ -45,6 +45,7 @@ struct GCFloatTy { __enzyme_fp fp; bool seen; GCFloatTy() : seen(false) {} + ~GCFloatTy() {} }; struct { std::list all; @@ -118,6 +119,7 @@ void enzyme_fprt_gc_doit() { for (auto it = __enzyme_mpfr_fps.all.begin(); it != __enzyme_mpfr_fps.all.end();) { if (!it->seen) { + mpfr_clear(it->fp.result); it = __enzyme_mpfr_fps.all.erase(it); } else { ++it;