Skip to content

Commit 098106d

Browse files
authored
Use the documented version of the enable_finalizers API. (#1111)
1 parent 504a495 commit 098106d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/utils/cache.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ end
1818
function Base.pop!(f::Function, cache::HandleCache{K,V}, key) where {K,V}
1919
function check_cache(f::Function=()->nothing)
2020
try
21-
GC.disable_finalizers()
21+
GC.enable_finalizers(false)
2222
lock(cache.lock) do
2323
handle = if !haskey(cache.idle_handles, key) || isempty(cache.idle_handles[key])
2424
f()
@@ -33,7 +33,7 @@ function Base.pop!(f::Function, cache::HandleCache{K,V}, key) where {K,V}
3333
return handle
3434
end
3535
finally
36-
GC.enable_finalizers()
36+
GC.enable_finalizers(true)
3737
end
3838
end
3939

0 commit comments

Comments
 (0)