mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 09:40:35 +05:00
- some memory leaks
This commit is contained in:
parent
38fb650b9e
commit
c15f8d1936
@ -192,10 +192,11 @@ namespace SMESH
|
||||
operator<<(CORBA::Object_ptr theArg)
|
||||
{
|
||||
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
|
||||
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
|
||||
SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
|
||||
SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
|
||||
if(!aSObject->_is_nil()) {
|
||||
myStream << aSObject->GetID();
|
||||
CORBA::String_var id = aSObject->GetID();
|
||||
myStream << id;
|
||||
} else if ( !CORBA::is_nil(theArg)) {
|
||||
if ( aSMESHGen->CanPublishInStudy( theArg )) // not published SMESH object
|
||||
myStream << "smeshObj_" << size_t(theArg);
|
||||
|
@ -210,8 +210,10 @@ GEOM::GEOM_Object_ptr SMESH_Gen_i::ShapeToGeomObject (const TopoDS_Shape& theSha
|
||||
GEOM_Client* aClient = GetShapeReader();
|
||||
TCollection_AsciiString IOR;
|
||||
if ( aClient && aClient->Find( theShape, IOR ))
|
||||
aShapeObj = GEOM::GEOM_Object::_narrow
|
||||
( GetORB()->string_to_object( IOR.ToCString() ) );
|
||||
{
|
||||
CORBA::Object_var obj = GetORB()->string_to_object( IOR.ToCString() );
|
||||
aShapeObj = GEOM::GEOM_Object::_narrow ( obj );
|
||||
}
|
||||
}
|
||||
return aShapeObj._retn();
|
||||
}
|
||||
@ -262,7 +264,8 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy,
|
||||
}
|
||||
if ( thePixMap ) {
|
||||
anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" );
|
||||
SALOMEDS::AttributePixMap::_narrow( anAttr )->SetPixMap( thePixMap );
|
||||
SALOMEDS::AttributePixMap_var pm = SALOMEDS::AttributePixMap::_narrow( anAttr );
|
||||
pm->SetPixMap( thePixMap );
|
||||
}
|
||||
if ( !theSelectable ) {
|
||||
anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeSelectable" );
|
||||
@ -518,13 +521,12 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SALOMEDS::Study_ptr theStudy,
|
||||
|
||||
// Publish global hypotheses
|
||||
|
||||
SMESH::ListOfHypothesis * hypList = theMesh->GetHypothesisList( aShapeObject );
|
||||
if ( hypList )
|
||||
for ( int i = 0; i < hypList->length(); i++ ) {
|
||||
SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( (*hypList)[ i ]);
|
||||
PublishHypothesis( theStudy, aHyp );
|
||||
AddHypothesisToShape( theStudy, theMesh, aShapeObject, aHyp );
|
||||
}
|
||||
SMESH::ListOfHypothesis_var hypList = theMesh->GetHypothesisList( aShapeObject );
|
||||
for ( int i = 0; i < hypList->length(); i++ ) {
|
||||
SMESH::SMESH_Hypothesis_var aHyp = SMESH::SMESH_Hypothesis::_narrow( hypList[ i ]);
|
||||
PublishHypothesis( theStudy, aHyp );
|
||||
AddHypothesisToShape( theStudy, theMesh, aShapeObject, aHyp );
|
||||
}
|
||||
}
|
||||
|
||||
// Publish submeshes
|
||||
|
Loading…
Reference in New Issue
Block a user