mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-12 12:50:08 +00:00
clear the m_userVisualShapeHandles at resetSimulation to avoid memory build-up (not a leak at exit, since memory was del-allocated in the destructor)
This commit is contained in:
parent
9185f93174
commit
a899725cc6
@ -240,6 +240,10 @@ struct InternalVisualShapeData
|
||||
|
||||
b3AlignedObjectArray<std::string> m_pathPrefixes;
|
||||
|
||||
virtual ~InternalVisualShapeData()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
void clear()
|
||||
{
|
||||
m_tinyRendererVisualShapeIndex = -1;
|
||||
@ -259,8 +263,14 @@ struct InternalCollisionShapeData
|
||||
m_used(0)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~InternalCollisionShapeData()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
void clear()
|
||||
{
|
||||
m_urdfCollisionObjects.clear();
|
||||
m_collisionShape = 0;
|
||||
m_used = 0;
|
||||
}
|
||||
@ -15949,6 +15959,9 @@ void PhysicsServerCommandProcessor::resetSimulation(int flags)
|
||||
m_data->m_bodyHandles.exitHandles();
|
||||
m_data->m_bodyHandles.initHandles();
|
||||
|
||||
m_data->m_userVisualShapeHandles.exitHandles();
|
||||
m_data->m_userVisualShapeHandles.initHandles();
|
||||
|
||||
m_data->m_userCollisionShapeHandles.exitHandles();
|
||||
m_data->m_userCollisionShapeHandles.initHandles();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user