How do I make sure an instantiate class has been garbage collected?
Title should say "instantiated".
I have a ScriptableObject A that instantiates a Class B, which does some stuff and then is needed no more. I can't destroy a class instance directly; I have tried removing all references to the class but I don't know how to tell if it's been collected. It's not a Monobehaviour so there is no OnDisable() in which I can put a debug.log.
Any reference to check if it is still alive will presumably prevent garbage collection, so it feels like Heisenberg's Uncertainty Principle.
Do I just wait and see if performance is hit by a memory leak...?
Posted Sep 5, 2019, 9:19 PM UTC
[deleted]