On additively loading a scene, I am creating a lot of procedural geometry and placing down a lot of static prefabs in that newly loaded (and active) scene. I’m then using StaticBatchingUtility.Combine to batch those together, which works great.
However, when the scene is unloaded, and all game objects containing the original meshes - and also the combined static meshes - are destroyed, my app is leaking memory. The memory profiler shows mesh allocations from the combined static meshes are not getting freed up.
What (if anything) am I doing wrong? How are we supposed to ensure that these allocations are freed?
There was a bug report raised by another person on this matter a few years back, unfortunately it has been closed as “Won’t Fix” without any comment or explanation that I can see:
We are using Unity 2019.1.5. Any help would be greatly appreciated.