Skip to content

Commit

Permalink
Fix task switch in GC finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Octogonapus committed Mar 5, 2024
1 parent f4fde9d commit e64857d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ForeignCallbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ mutable struct ForeignCallback{T}
end
this = new{T}(stack, cond, task)
finalizer(this) do this
close(this.cond)
# TODO: free queue we are leaking at least one node here
Base.errormonitor(Threads.@spawn begin
close(this.cond)
# TODO: free queue we are leaking at least one node here
end)
end
end
end
Expand Down

0 comments on commit e64857d

Please sign in to comment.