3 ms·
By checking if things are referenced or not as the basis for collection is a bad idea. Take 2 classes that reference each other, but nothing references either.
by WirelessGigabit 4y ago
By checking if things are referenced or not as the basis for collection is a bad idea.
Take 2 classes that reference each other, but nothing references either.
In your example they won't get cleaned up. You'll want a tree-based collector. If an object is no longer referenced from the tree it can be cleaned up.