I’m currently working on a project, where I am using a LevelBuilder script to build the chosen level. It reads a string from a file, interprets each substring as a level segment and attaches them next to one another. so far so good, the level builder is working great.
But when testing it more extensively and loading one level after another, after a few scene changes I notice uncontrolled behaviour, like not loading the level at all, or only loading it sometimes.
I took a snapshot of the heap, and i noticed a constant increase in the number of btVector3 objects that got created. I was wondering why the memory wasn’t released and assumed it was a mistake in my code. But I created a small sample project, just with a basic cube in both scenes. And after each scene transition, the number of bt-objects increased, even though I don’t keep any references of objects of the other scene.
example scene: Sample Project
Is this behaviour intended or a bug? Is there a way to release the memory manually? how can i avoid an overflow, if I have to load lots and lots of objects?