From 057fdee0c2b91346e700847fbd6aa3bf38d986db Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Thu, 13 Jun 2024 14:05:48 +0200 Subject: [PATCH] Close the default Context in the precompilation workload --- src/ZMQ.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ZMQ.jl b/src/ZMQ.jl index 8805754..9a74306 100644 --- a/src/ZMQ.jl +++ b/src/ZMQ.jl @@ -85,6 +85,13 @@ import PrecompileTools: @compile_workload unsafe_string(ZMQ.recv(s2)) ZMQ.close(s1) ZMQ.close(s2) + + # Using the library like this workload will initialize ZMQ._context, which + # contains a pointer. This doesn't seem to play well with serialization on + # Julia 1.6 with PackageCompiler so we explicitly close it to reset the + # pointer. + # See: https://github.com/JuliaLang/julia/issues/46214 + close(ZMQ._context) end end