deconstructors / deinitializers
Feature found in a lot of programming languages.
Universally tends to have a fairly large number of sharp edges:
- in Swift
deinitis always nonisolated which makes it annoying in Swift Concurrency contexts and often requires spawning a task - timing of when a deconstructor runs is unpredictable in garbage collected languages due to it being hard to know when the garbage collector will garbage collect the type after it is no longer being referenced