I want to remove some WeakRef related resources, e.g.
struct Blah
dummy::String
end
a = Blah("abc")
b = Dict()
b["a"] = WeakRef(a)
function do_cleaning()
for (k, v) in b
if v.value == nothing
delete!(b, k)
end
end
end
a = nothing
GC.gc()
show(b) # b["a"]=>Blah()
do_cleaning() # Make this automatic after a GC round!
show(b) # empty
Is it possible?