Weak Reference class that allows a referenced object to be garbage-collected.
require "weak_ref" ref = WeakRef.new("oof".reverse) p ref.value # => "foo" GC.collect p ref.value # => nil
Reference
Reference
Object
Object
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/WeakRef.html