From 562400b5827b353d7554a6b3a1073e8c24dc79f6 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 31 Dec 2023 08:17:54 -0500 Subject: [PATCH] Update ext/IntegralsGSLExt.jl --- ext/IntegralsGSLExt.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/IntegralsGSLExt.jl b/ext/IntegralsGSLExt.jl index 327f47b..87babf6 100644 --- a/ext/IntegralsGSLExt.jl +++ b/ext/IntegralsGSLExt.jl @@ -38,7 +38,7 @@ function Integrals.__solvebp_call(cache::IntegralCache, alg::GSLIntegration{type end # gslf = @gsl_function(f) # broken, see: https://github.com/JuliaMath/GSL.jl/pull/128 ptr = @cfunction($((x,p) -> f(x)), Cdouble, (Cdouble, Ptr{Cvoid})) - gslf = gsl_function(Base.unsafe_convert(Ptr{Cvoid},ptr), 0) + gslf = GC.@preserve ptr gsl_function(Base.unsafe_convert(Ptr{Cvoid},ptr), 0) a, b = map(Cdouble∘only, domain) (; gslcache, result, abserr, nevals) = cache.cacheval integration_cquad(gslf, a, b, abstol, reltol, getvalue(gslcache), result, abserr, nevals)