mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 13:50:04 +00:00
Merge pull request #1252 from erwincoumans/master
fix pybullet GUI performance issue on Mac OSX, fix potential memory leak in loadSDF when visuals have the same name.
This commit is contained in:
commit
dfaa717fed
@ -569,6 +569,15 @@ bool UrdfParser::parseVisual(UrdfModel& model, UrdfVisual& visual, TiXmlElement*
|
||||
matPtr->m_name = "mat";
|
||||
if (name_char)
|
||||
matPtr->m_name = name_char;
|
||||
|
||||
UrdfMaterial** oldMatPtrPtr = model.m_materials[matPtr->m_name.c_str()];
|
||||
if (oldMatPtrPtr)
|
||||
{
|
||||
UrdfMaterial* oldMatPtr = *oldMatPtrPtr;
|
||||
model.m_materials.remove(matPtr->m_name.c_str());
|
||||
if (oldMatPtr)
|
||||
delete oldMatPtr;
|
||||
}
|
||||
model.m_materials.insert(matPtr->m_name.c_str(),matPtr);
|
||||
{
|
||||
TiXmlElement *diffuse = mat->FirstChildElement("diffuse");
|
||||
|
@ -53,13 +53,13 @@ public:
|
||||
}
|
||||
}
|
||||
{
|
||||
//unsigned long int ms = m_clock.getTimeMilliseconds();
|
||||
//if (ms>2)
|
||||
unsigned long int ms = m_clock.getTimeMilliseconds();
|
||||
if (ms>2)
|
||||
{
|
||||
// B3_PROFILE("m_clock.reset()");
|
||||
B3_PROFILE("m_clock.reset()");
|
||||
|
||||
// m_clock.reset();
|
||||
btUpdateInProcessExampleBrowserMainThread(m_data);
|
||||
btUpdateInProcessExampleBrowserMainThread(m_data);
|
||||
m_clock.reset();
|
||||
}
|
||||
}
|
||||
{
|
||||
|
@ -1277,8 +1277,21 @@ void btConvexHullInternal::computeInternal(int start, int end, IntermediateHull&
|
||||
|
||||
return;
|
||||
}
|
||||
{
|
||||
Vertex* v = originalVertices[start];
|
||||
v->edges = NULL;
|
||||
v->next = v;
|
||||
v->prev = v;
|
||||
|
||||
result.minXy = v;
|
||||
result.maxXy = v;
|
||||
result.minYx = v;
|
||||
result.maxYx = v;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
// lint -fallthrough
|
||||
|
||||
case 1:
|
||||
{
|
||||
Vertex* v = originalVertices[start];
|
||||
|
@ -98,6 +98,7 @@ SIMD_FORCE_INLINE bool btMutexTryLock( btSpinMutex* mutex )
|
||||
class btIParallelForBody
|
||||
{
|
||||
public:
|
||||
virtual ~btIParallelForBody() {}
|
||||
virtual void forLoop( int iBegin, int iEnd ) const = 0;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user