Memory leak hunting

This commit is contained in:
Anthony Geay 2021-08-17 10:07:11 +02:00
parent 8d185cc9e6
commit 465e5be442
3 changed files with 11 additions and 5 deletions

View File

@ -5917,7 +5917,8 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
if ( aNewGroup->_is_nil() )
continue;
string iorSubString = GetORB()->object_to_string( aNewGroup );
CORBA::String_var iorSubStringVar = GetORB()->object_to_string( aNewGroup );
string iorSubString(iorSubStringVar.in());
int newSubId = myStudyContext->findId( iorSubString );
myStudyContext->mapOldToNew( subid, newSubId );
@ -6240,8 +6241,9 @@ int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject)
CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
{
if ( myStudyContext && !CORBA::is_nil( theObject )) {
string iorString = GetORB()->object_to_string( theObject );
return myStudyContext->findId( iorString );
CORBA::String_var iorString = GetORB()->object_to_string( theObject );
string iorStringCpp(iorString.in());
return myStudyContext->findId( iorStringCpp );
}
return 0;
}

View File

@ -548,8 +548,11 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = getStudyServant()->GetUseCaseBuilder();
std::string compDataType = ComponentDataType(); // SMESH module's data type
std::string ior = SMESH_Gen_i::GetORB()->object_to_string( SMESH_Gen::_this() ); // IOR of this SMESH engine
std::string ior;
{
CORBA::String_var iorString = GetORB()->object_to_string( SMESH_Gen::_this() );
ior = std::string( iorString.in() ); // IOR of this SMESH engine
}
// Find study component which corresponds to this SMESH engine
SALOMEDS::SComponent_wrap father;

View File

@ -272,6 +272,7 @@ namespace
dataset->WriteOnDisk( & data[0] );
dataset->CloseOnDisk();
anArray->CloseOnDisk();
delete anArray;
}
}
}