From bf0c697cdb30dd1b051908b56bda24fe2cc8fa11 Mon Sep 17 00:00:00 2001 From: Neil Toronto Date: Wed, 9 Jan 2013 11:20:27 -0700 Subject: [PATCH] MPFR custodian shutdown procedure tries to clear the constants cache even when MPFR isn't loaded; this should close PR 13423 (cherry picked from commit 441ad6eff42ae581deec8ea1990803753283f0ca) --- collects/math/private/bigfloat/mpfr.rkt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/collects/math/private/bigfloat/mpfr.rkt b/collects/math/private/bigfloat/mpfr.rkt index e9e38e6e70..7dbe34a041 100644 --- a/collects/math/private/bigfloat/mpfr.rkt +++ b/collects/math/private/bigfloat/mpfr.rkt @@ -81,9 +81,10 @@ (register-custodian-shutdown mpfr-free-cache ; acts as a "random" object for a shutdown handle (λ (free) - ;; The direct reference here is important, since custodian holds only - ;; a weak reference to shutdown handle: - (mpfr-free-cache)))) + (when mpfr-lib + ;; The direct reference here is important, since custodian holds only + ;; a weak reference to shutdown handle: + (mpfr-free-cache))))) ;; =================================================================================================== ;; MPFR types