Skip to content

Commit

Permalink
Close the default Context in the precompilation workload
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWrigley committed Jun 13, 2024
1 parent 2032aef commit 9f7801f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/src/_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Changelog](https://keepachangelog.com).

- [`lib_version()`](@ref) to get the libzmq version ([#240]).

### Fixed

- Fixed a precompilation bug that would cause creating a sysimage with
PackageCompiler.jl on Julia 1.6 to fail ([#242]).

## [v1.2.5] - 2024-05-28

### Fixed
Expand Down
7 changes: 7 additions & 0 deletions src/ZMQ.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9f7801f

Please sign in to comment.