My code is devouring memory at an alarming rate and ultimately crashing.
After some investigation, I've determined that the issue seems to be related to the torus generation/removal portion of the code. Despite efforts to manage the scene array and torus array effectively by reducing their lengths as shapes are removed, the memory leak persists.
Any suggestions on how to troubleshoot this?