aboutsummaryrefslogtreecommitdiffstats
path: root/mpfr.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mpfr.c b/mpfr.c
index e9c9d154..52247978 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -89,6 +89,15 @@ init_mpfr(mpfr_prec_t prec, const char *rmode)
register_exec_hook(mpg_interpret, 0);
}
+/* cleanup_mpfr --- clean stuff up, mainly for valgrind */
+
+void
+cleanup_mpfr(void)
+{
+ mpfr_clear(_mpf_t1);
+ mpfr_clear(_mpf_t2);
+}
+
/* mpg_node --- allocate a node to store MPFR float or GMP integer */
NODE *
@@ -1239,6 +1248,8 @@ do_mpfr_div(int nargs)
mpz_tdiv_qr(quotient->mpg_i, remainder->mpg_i, num->mpg_i, denom->mpg_i);
unref(num);
unref(denom);
+ unref(numerator);
+ unref(denominator);
sub = make_string("quotient", 8);
lhs = assoc_lookup(result, sub);