iex
06/19/2017, 9:47 PMdiesieben07
06/19/2017, 9:49 PMfinalize
. There are discussions about discussions about why finalize
is terrible though. You should really use the Closeable
interface with the use
function.WeakReference
/ SoftReference
, which can notify you through a ReferenceQueue
, but the use-case is extremely limited. It's not a good idea to rely on the garbage collector in this way.