I'm having large allocations from Spine runtime in Cocos2d-x. It keeps allocating until out of memory, then crashes.
I'm using GitHub's version (cloned 5 days ago, also having the problem with older version) I've found the allocations in this function:
spine::SkeletonBatch::nextFreeCommand()
Looking at the code, Spine allocates more memory when out of "commands slots".
What can cause to allocate more "commands slots"? My game is paused and the runtime keeps allocating more and more memory.
I just let the game running and eventually will crash. I'm not creating new skeletons, I preload all skeletons at load map, so there are always the same number of skeletons running.
Any idea or some guide to search where the problem could be?
Attach the stack call.
Thanks a lot.
EDIT: I think something is not being released when changing from scene because I can reproduce the problem now. Fails when going to main menu and start a second game. After this allocations ramp up considerably. I'm still digging into it.
EDIT 2: I've solved the problem destroying instance of SkeletonBatch (SkeletonBatch::getInstance()->destroyInstance()), so I think there is something there not being deallocated. Any idea?