From: rahuel Date: Thu, 14 Apr 2005 12:04:56 +0000 (+0000) Subject: Memory Leaks X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cdb2f93a5988bb23d473aae5cd019eac07c05c4d;p=modules%2Fsuperv.git Memory Leaks --- diff --git a/src/Supervision/CNode_Impl.cxx b/src/Supervision/CNode_Impl.cxx index 55724b0..ac129a1 100644 --- a/src/Supervision/CNode_Impl.cxx +++ b/src/Supervision/CNode_Impl.cxx @@ -609,7 +609,8 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) { hasinput = DataFlowEditor()->HasInput( anInPort->PortName() ) ; } if ( hasinput ) { - const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; + const CORBA::Any anAny = anInPort->GetOutPort()->Value() ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , @@ -617,7 +618,7 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) { // ServiceParameterName , (GraphBase::Port * ) anInPort , true , - anAny ) ; + &anAny ) ; } else { myPort = new Port_Impl( _Orb , _Poa , _ContId , @@ -653,7 +654,8 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) { beginService( "CNode_Impl::Port" ); begin = false ; } - const CORBA::Any * anAny = anOutPort->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ; + const CORBA::Any anAny = anOutPort->Value() ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , @@ -661,7 +663,7 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) { // ServiceParameterName , (GraphBase::Port * ) anOutPort , false , - anAny ) ; + &anAny ) ; PortableServer::ObjectId * id = myPort->getId() ; CORBA::Object_var obj = _poa->id_to_reference(*id); iobject = SUPERV::Port::_narrow(obj) ; @@ -805,14 +807,15 @@ SUPERV::Port_ptr CNode_Impl::GetOutPort( const char *aParameterName ) { if ( anOutPort && !anOutPort->IsDataStream() ) { Outobject = anOutPort->ObjRef() ; if ( CORBA::is_nil( Outobject ) ) { - const CORBA::Any * anAny = anOutPort->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ; + const CORBA::Any anAny = anOutPort->Value() ; myOutPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anOutPort , false , - anAny ) ; + &anAny ) ; if ( myOutPort ) { PortableServer::ObjectId * id = myOutPort->getId() ; CORBA::Object_var obj = _poa->id_to_reference(*id) ; @@ -858,14 +861,15 @@ SUPERV::StreamPort_ptr CNode_Impl::GetOutStreamPort( const char *aParameterName if ( anOutPort && anOutPort->IsDataStream() ) { Outobject = SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ; if ( CORBA::is_nil( Outobject ) ) { - const CORBA::Any * anAny = anOutPort->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ; + const CORBA::Any anAny = anOutPort->Value() ; myOutStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anOutPort , false , - anAny ) ; + &anAny ) ; if ( myOutStreamPort ) { PortableServer::ObjectId * id = myOutStreamPort->getId() ; CORBA::Object_var obj = _poa->id_to_reference(*id) ; @@ -1001,14 +1005,15 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { // << "/" << anInPort->IsNotConnected() ) ; Port_Impl * myPort ; if ( DataFlowNode()->HasInput( anInPort->PortName() ) ) { - const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; + const CORBA::Any anAny = anInPort->GetOutPort()->Value() ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anInPort , true , - anAny ) ; + &anAny ) ; } else { myPort = new Port_Impl( _Orb , _Poa , _ContId , @@ -1051,14 +1056,15 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { } else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) { // MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ; - const CORBA::Any * anAny = anOutPort->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ; + const CORBA::Any anAny = anOutPort->Value() ; Port_Impl * myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anOutPort , false , - anAny ) ; + &anAny ) ; PortableServer::ObjectId * id = myPort->getId() ; CORBA::Object_var obj = _poa->id_to_reference(*id); SUPERV::Port_var iobject ; @@ -1095,14 +1101,15 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { } Port_Impl * myPort ; if ( anOutPort->IsDataConnected() ) { - const CORBA::Any * anAny = anOutPort->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ; + const CORBA::Any anAny = anOutPort->Value() ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anOutPort , true , - anAny ) ; + &anAny ) ; } else { myPort = new Port_Impl( _Orb , _Poa , _ContId , @@ -1141,14 +1148,15 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { } Port_Impl * myPort ; if ( anInPort->IsDataConnected() ) { - const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; + const CORBA::Any anAny = anInPort->GetOutPort()->Value() ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anInPort , false , - anAny ) ; + &anAny ) ; } else { myPort = new Port_Impl( _Orb , _Poa , _ContId , @@ -1219,14 +1227,15 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { << "/" << anInPort->IsNotConnected() ) ; StreamPort_Impl * myStreamPort ; if ( DataFlowNode()->HasInput( anInPort->PortName() ) ) { - const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; + const CORBA::Any anAny = anInPort->GetOutPort()->Value() ; myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anInPort , true , - anAny ) ; + &anAny ) ; } else { myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , @@ -1270,14 +1279,15 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { } else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) { MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ; - const CORBA::Any * anAny = anOutPort->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ; + const CORBA::Any anAny = anOutPort->Value() ; StreamPort_Impl * myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anOutPort , false , - anAny ) ; + &anAny ) ; PortableServer::ObjectId * id = myStreamPort->getId() ; CORBA::Object_var obj = _poa->id_to_reference(*id); SUPERV::StreamPort_var iobject ; @@ -1313,14 +1323,15 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { } StreamPort_Impl * myStreamPort ; if ( anOutPort->IsDataConnected() ) { - const CORBA::Any * anAny = anOutPort->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ; + const CORBA::Any anAny = anOutPort->Value() ; myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anOutPort , true , - anAny ) ; + &anAny ) ; } else { myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , @@ -1360,14 +1371,15 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { } StreamPort_Impl * myStreamPort ; if ( anInPort->IsDataConnected() ) { - const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; + const CORBA::Any anAny = anInPort->GetOutPort()->Value() ; myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anInPort , false , - anAny ) ; + &anAny ) ; } else { myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , diff --git a/src/Supervision/Graph_Impl.cxx b/src/Supervision/Graph_Impl.cxx index edc316d..b18c89a 100644 --- a/src/Supervision/Graph_Impl.cxx +++ b/src/Supervision/Graph_Impl.cxx @@ -822,7 +822,8 @@ SUPERV::Graph_var Graph_Impl::LoadDataFlows( GraphExecutor::DataFlow * aDataFlow const GraphBase::InPort * anInPort = aMacroNode->GetNodeInPort( q ) ; if ( anInPort->IsDataConnected() ) { const char* aMacroGraphInPortName = aMacroGraph->GetNodeInPort( q )->PortName(); - if ( !aMacroGraphExecutor->InputOfAny( aMacroGraphInPortName, *anInPort->GetOutPort()->Value(),false ) ) { +//JR 30.03.2005 if ( !aMacroGraphExecutor->InputOfAny( aMacroGraphInPortName, *anInPort->GetOutPort()->Value(),false ) ) { + if ( !aMacroGraphExecutor->InputOfAny( aMacroGraphInPortName, anInPort->GetOutPort()->Value(),false ) ) { return SUPERV::Graph::_duplicate( SUPERV::Graph::_nil() ) ; } else { @@ -1484,6 +1485,7 @@ SUPERV::ListOfLinks * Graph_Impl::Links( GraphBase::ComputingNode * theNode , // << anOutPort->PortName() << ") --> " << aNode->Name() << "(" // << anInPort->PortName() << ")" ) ; if ( theNode == NULL || +//PAL8521 //JR 14.02.2005 : Debug : we must see also that links ! // ( theNode != NULL && !theNode->IsEndSwitchNode() && !strcmp( theNode->Name() , aNode->Name() ) ) { @@ -1555,6 +1557,7 @@ SUPERV::ListOfLinks * Graph_Impl::Links( GraphBase::ComputingNode * theNode , if ( theNode == NULL || !strcmp( theNode->Name() , aNode->Name() ) ) { if ( !anInPort->IsDataStream() ) { +//PAL8521 //JR 14.02.2005 : Debug : we must see also that links ! // if ( theNode || ( toNode->IsEndSwitchNode() && !aNode->IsSwitchNode() ) ) { if ( anInputParam == NULL || diff --git a/src/Supervision/INode_Impl.cxx b/src/Supervision/INode_Impl.cxx index 1e40397..fe5d9ef 100644 --- a/src/Supervision/INode_Impl.cxx +++ b/src/Supervision/INode_Impl.cxx @@ -243,14 +243,15 @@ SUPERV::Port_ptr INode_Impl::OutPort( const char *aParameterName , if ( anOutPort ) { Outobject = anOutPort->ObjRef() ; if ( CORBA::is_nil( Outobject ) ) { - const CORBA::Any * anAny = anOutPort->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ; + const CORBA::Any anAny = anOutPort->Value() ; myOutPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anOutPort , false , - anAny ) ; + &anAny ) ; if ( myOutPort ) { PortableServer::ObjectId * id = myOutPort->getId() ; CORBA::Object_var obj = _poa->id_to_reference(*id) ; @@ -336,14 +337,15 @@ SUPERV::StreamPort_ptr INode_Impl::OutStreamPort( const char * aParameterName , if ( anOutPort ) { Outobject = SUPERV::StreamPort::_narrow( anOutPort->ObjRef() ) ; if ( CORBA::is_nil( Outobject ) ) { - const CORBA::Any * anAny = anOutPort->Value() ; +//JR 30.03.2005 const CORBA::Any * anAny = anOutPort->Value() ; + const CORBA::Any anAny = anOutPort->Value() ; myOutStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , DataFlowEditor() , DataFlowNode() , (GraphBase::Port * ) anOutPort , false , - anAny ) ; + &anAny ) ; if ( myOutStreamPort ) { PortableServer::ObjectId * id = myOutStreamPort->getId() ; CORBA::Object_var obj = _poa->id_to_reference(*id) ; diff --git a/src/Supervision/Value_Impl.cxx b/src/Supervision/Value_Impl.cxx index 9b948e6..96e7d75 100644 --- a/src/Supervision/Value_Impl.cxx +++ b/src/Supervision/Value_Impl.cxx @@ -154,6 +154,7 @@ bool Value_Impl::Input( const CORBA::Any * anAny ) { } CORBA::Any * Value_Impl::ToAny() { + beginService( "Value_Impl::ToAny" ); CORBA::Any * anAny ; if ( _DataFlowEditor ) { char * name ; @@ -163,6 +164,7 @@ CORBA::Any * Value_Impl::ToAny() { else { name = _DataFlowEditor->Graph()->Name() ; } + MESSAGE( "ToAny " << name<< "( " << _ParameterName << " )" ) ; if ( _InputPort ) { if ( _DataFlowNode ) { _InputValue = _DataFlowNode->HasInput( _ParameterName ) ; @@ -172,12 +174,14 @@ CORBA::Any * Value_Impl::ToAny() { } GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; if ( _DataFlowExecutor ) { - anAny = new CORBA::Any( * _DataFlowExecutor->GetInData( name , - _ParameterName ) ) ; +//JR 30.03.2005 anAny = new CORBA::Any( * _DataFlowExecutor->GetInData( name , + anAny = new CORBA::Any( _DataFlowExecutor->GetInData( name , + _ParameterName ) ) ; } else if ( _InputValue ) { - anAny = new CORBA::Any( * _DataFlowEditor->GetInData( name , - _ParameterName ) ) ; +//JR 30.03.2005 anAny = new CORBA::Any( * _DataFlowEditor->GetInData( name , + anAny = new CORBA::Any( _DataFlowEditor->GetInData( name , + _ParameterName ) ) ; } else { anAny = new CORBA::Any( *_Any ) ; @@ -186,8 +190,9 @@ CORBA::Any * Value_Impl::ToAny() { else { GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; if ( _DataFlowExecutor ) { - anAny = new CORBA::Any( * _DataFlowExecutor->GetOutData( name , - _ParameterName ) ) ; +//JR 30.03.2005 anAny = new CORBA::Any( * _DataFlowExecutor->GetOutData( name , + anAny = new CORBA::Any( _DataFlowExecutor->GetOutData( name , + _ParameterName ) ) ; } else { anAny = new CORBA::Any( *_Any ) ; @@ -197,12 +202,14 @@ CORBA::Any * Value_Impl::ToAny() { else { anAny = new CORBA::Any( *_Any ) ; } + endService( "Value_Impl::ToAny" ); return anAny ; } char * Value_Impl::ToString() { // beginService( "Value_Impl::ToString" ); - CORBA::Any anAny = *ToAny() ; +//JR 22.03.2005 Memory Leak CORBA::Any anAny = *ToAny() ; + CORBA::Any anAny ; if ( _DataFlowEditor ) { char * name ; if ( _DataFlowNode ) { @@ -211,7 +218,7 @@ char * Value_Impl::ToString() { else { name = _DataFlowEditor->Graph()->Name() ; } -// cout << "Value_Impl::ToString " << name << " " << _ParameterName << " " ; +// MESSAGE( "ToString " << name<< "( " << _ParameterName << " )" ) ; if ( _InputPort ) { if ( _DataFlowNode ) { _InputValue = _DataFlowNode->HasInput( _ParameterName ) ; @@ -221,15 +228,20 @@ char * Value_Impl::ToString() { } GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; if ( _DataFlowExecutor ) { -// cout << "_DataFlowExecutor->GetInData" << endl ; - anAny = * _DataFlowExecutor->GetInData( name , - _ParameterName ) ; +// cout << "-->_DataFlowExecutor->GetInData " << name << " " << _ParameterName << endl ; +//JR 30.03.2005 const CORBA::Any * AnyPtr = _DataFlowExecutor->GetInData( name , + const CORBA::Any AnyRef = _DataFlowExecutor->GetInData( name , + _ParameterName ) ; +//JR 30.03.2005 cout << "<--_DataFlowExecutor->GetInData " << AnyPtr << endl ; +//JR 30.03.2005 anAny = * AnyPtr ; + anAny = AnyRef ; } else if ( _InputValue ) { // cout << "_DataFlowEditor->GetInData _DataFlowNode " << _DataFlowNode // << " _InputValue " << _InputValue << endl ; - anAny = * _DataFlowEditor->GetInData( name , - _ParameterName ) ; +//JR 30.03.2005 anAny = * _DataFlowEditor->GetInData( name , + anAny = _DataFlowEditor->GetInData( name , + _ParameterName ) ; } else { anAny = *_Any ; @@ -238,8 +250,13 @@ char * Value_Impl::ToString() { else { GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; if ( _DataFlowExecutor ) { - anAny = * _DataFlowExecutor->GetOutData( name , - _ParameterName ) ; +// cout << "-->_DataFlowExecutor->GetOutData " << name << " " << _ParameterName << endl ; +//JR 30.03.2005 const CORBA::Any * AnyPtr = _DataFlowExecutor->GetOutData( name , + const CORBA::Any AnyRef = _DataFlowExecutor->GetOutData( name , + _ParameterName ) ; +//JR 30.03.2005 cout << "<--_DataFlowExecutor->GetOutData " << AnyPtr << endl ; +//JR 30.03.2005 anAny = * AnyPtr ; + anAny = AnyRef ; } else { anAny = *_Any ; @@ -315,27 +332,31 @@ bool Value_Impl::IsIOR() { _InputValue = _DataFlowEditor->HasInput( _ParameterName ) ; } if ( _InputValue && _DataFlowEditor->IsEditing() ) { - anAny = * _DataFlowEditor->GetInData( name , - _ParameterName ) ; +//JR 30.03.2005 anAny = * _DataFlowEditor->GetInData( name , + anAny = _DataFlowEditor->GetInData( name , + _ParameterName ) ; } else { GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; if ( _DataFlowExecutor ) { - anAny = * _DataFlowExecutor->GetInData( name , - _ParameterName ) ; +//JR 30.03.2005 anAny = * _DataFlowExecutor->GetInData( name , + anAny = _DataFlowExecutor->GetInData( name , + _ParameterName ) ; } } } else { if ( _InputValue && _DataFlowEditor->IsEditing() ) { - anAny = * _DataFlowEditor->GetOutData( name , - _ParameterName ) ; +//JR 30.03.2005 anAny = * _DataFlowEditor->GetOutData( name , + anAny = _DataFlowEditor->GetOutData( name , + _ParameterName ) ; } else { GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; if ( _DataFlowExecutor ) { - anAny = * _DataFlowExecutor->GetOutData( name , - _ParameterName ) ; +//JR 30.03.2005 anAny = * _DataFlowExecutor->GetOutData( name , + anAny = _DataFlowExecutor->GetOutData( name , + _ParameterName ) ; } } }