3 ms·
> This rather innocent looking class creates a cycle when you fill in the values, because the parent and child reference each other. That cycle now means your n
by saagarjha 7y ago
> This rather innocent looking class creates a cycle when you fill in the values, because the parent and child reference each other. That cycle now means your nodes will not be cleaned up anymore.
It’s fairly common knowledge, but just to answer the inevitable question: you can avoid the cycle with weak pointers.