ephysics: soft body memory usage/leak

Added a call for sparsesdf garbage collector after every simulation
avoiding bullet's soft dynamics leaks.


Patch by: Leandro Dorileo <dorileo@profusion.mobi>



SVN revision: 76561
This commit is contained in:
Leandro Dorileo 2012-09-12 21:49:29 +00:00 committed by Bruno Dilly
parent 3ecddb724a
commit 075029bdfe
1 changed files with 4 additions and 1 deletions

View File

@ -276,8 +276,11 @@ _simulate_worlds(void *data __UNUSED__)
gDeactivationTime = world->max_sleeping_time;
if (world->soft_body_ref)
world->dynamics_world->stepSimulation(delta, world->max_sub_steps,
{
world->dynamics_world->stepSimulation(delta, world->max_sub_steps,
world->fixed_time_step);
world->world_info->m_sparsesdf.GarbageCollect();
}
else
((btDiscreteDynamicsWorld *)world->dynamics_world)->stepSimulation(
delta, world->max_sub_steps, world->fixed_time_step);