Play mode and builds working but unstoppable

Hi everyone,
I have a project, where I instantiate some nested prefabs (standard cubes and cylinders). Basically one pillar with 4 walls each which can be extruded and rotated with mouse inputs (clicks and scrolls). From my point of view no rocket sience and kept simple.

The project is running fine and I do not get any problems on runtime in play mode. But if I’m trying to stop play mode, unity freezes for a long time, sometimes forever. If I build a stand alone exe file, I can run it too, but it will not stop on close and task needs to be killed. Both, the unity editor and the exe file use all my RAM and without “doing anything” RAM consumption increases “indefinetely” (14 GB).

So I cleanded my scripts and rebuilt functionallyties, and cut a lot of “memory eaters” … at least that’s what I thought. And now I’m left behind… I have no idea, what is causing the problem and how to prevent it. So, maybe anyone of you has got an idea… Thanks for your support in advance…

Unity 5.6.0f3 / project attached to this post.

3061095–229981–tina-turner.zip (73.3 KB)

Try open your Profiler press play and look if something in the memory section catches your eye.

Hi fffMalzbier,
thank you for that advice.

Even if not expected, your hint was the right trigger for a solution to my problem.

For anyone wondering: My script did a lot of renderer.meaterial calls, which led to an ever increasing amount of material references… which do not destroy or unload themselfves and therefor need to be controled by the script, too.
This link provided the needed information.

Thanks!