Skip to content

Commit

Permalink
Hopefully fix #76
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Mar 23, 2015
1 parent 02e4afb commit 791b5d4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ZMQ.jl
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,16 @@ end
const gc_protect = Dict{Ptr{Void},Any}()
# 0.2 compatibility
gc_protect_cb(work, status) = gc_protect_cb(work)
gc_protect_cb(work) = pop!(gc_protect, work.handle, nothing)
if VERSION < v"0.4.0-dev+3970"
function close_handle(work)
Base.disassociate_julia_struct(work.handle)
ccall(:jl_close_uv,Void,(Ptr{Void},),work.handle)
Base.unpreserve_handle(work)
end
else
close_handle(work) = Base.close(work)
end
gc_protect_cb(work) = (pop!(gc_protect, work.handle, nothing); close_handle(work))
function gc_protect_handle(obj::Any)
work = Base.SingleAsyncWork(gc_protect_cb)
gc_protect[work.handle] = (work,obj)
Expand Down

0 comments on commit 791b5d4

Please sign in to comment.