From: eap Date: Fri, 14 Dec 2012 14:00:03 +0000 (+0000) Subject: 21948: EDF SMESH : Memory is not freed when deleting a mesh X-Git-Tag: V6_main_FINAL~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7003c25174204d7805f5d804631e2f0a3d96f290;p=plugins%2Fnetgenplugin.git 21948: EDF SMESH : Memory is not freed when deleting a mesh Elimenate memory leaks on CORBA objects, servants of SALOMEDS objects etc --- diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index d8b8e93..c24a535 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -230,12 +230,10 @@ void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp) GEOM::GEOM_Object_var aGeomObj; TopoDS_Shape S = TopoDS_Shape(); SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.c_str() ); - SALOMEDS::GenericAttribute_var anAttr; - if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeIOR")) { - SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - CORBA::String_var aVal = anIOR->Value(); - CORBA::Object_var obj = myStudy->ConvertIORToObject(aVal); + if (!aSObj->_is_nil()) { + CORBA::Object_var obj = aSObj->GetObject(); aGeomObj = GEOM::GEOM_Object::_narrow(obj); + aSObj->UnRegister(); } if ( !aGeomObj->_is_nil() ) S = smeshGen_i->GeomObjectToShape( aGeomObj.in() ); @@ -2031,7 +2029,9 @@ namespace std::string text(netgen::NgException& ex) { SMESH_Comment str("NgException"); - str << " at " << netgen::multithread.task << ": " << ex.What(); + if ( strlen( netgen::multithread.task ) > 0 ) + str << " at " << netgen::multithread.task; + str << ": " << ex.What(); return str; } }