fix leak in loadSDF in case of visuals with duplicate/identical names that have a material.

fix GUI performance issue on Mac OSX
fix issue introduced in previous commit (in btConvexHullComputer.cpp)
This commit is contained in:
erwincoumans
2017-08-11 17:14:52 -07:00
parent c67a70cb09
commit 457312f94f
3 changed files with 24 additions and 15 deletions

View File

@@ -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");

View File

@@ -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);
m_clock.reset();
}
}
{

View File

@@ -1277,7 +1277,6 @@ void btConvexHullInternal::computeInternal(int start, int end, IntermediateHull&
return;
}
}
{
Vertex* v = originalVertices[start];
v->edges = NULL;
@@ -1292,6 +1291,7 @@ void btConvexHullInternal::computeInternal(int start, int end, IntermediateHull&
return;
}
case 1:
{
Vertex* v = originalVertices[start];