3 ms·
> don't typically support RAII because it does not mix well with GC semantics Just to expand on this a little, one problem is that no matter how you collect a
by cousin_it 11y ago
> don't typically support RAII because it does not mix well with GC semantics
Just to expand on this a little, one problem is that no matter how you collect a cycle of objects with finalizers, one of them will see the others in a finalized state. Another problem is resurrection, where the finalizer creates a new reference to self or another finalized object. You could try solving these problems by nulling all references to finalized objects (including self) during GC, but that makes finalizers useless. I don't know any good solution.