From 9a197948940162bb98920133b45db707b9ca8f60 Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 6 Apr 2005 11:56:40 +0000 Subject: [PATCH] Added CORBA::release to destrutors --- src/SALOMEDS/SALOMEDS_AttributeName.cxx | 2 ++ src/SALOMEDS/SALOMEDS_GenericAttribute.cxx | 6 ++++-- src/SALOMEDS/SALOMEDS_SObject.cxx | 3 ++- src/SALOMEDS/SALOMEDS_Study.cxx | 3 ++- src/SALOMEDS/SALOMEDS_StudyBuilder.cxx | 3 ++- src/SALOMEDS/SALOMEDS_StudyManager.cxx | 3 ++- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS_AttributeName.cxx b/src/SALOMEDS/SALOMEDS_AttributeName.cxx index 37ec308a5..f3636add8 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeName.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeName.cxx @@ -23,6 +23,8 @@ char* SALOMEDS_AttributeName::Value() TCollection_AsciiString aValue; if(_isLocal) aValue = Handle(SALOMEDSImpl_AttributeName)::DownCast(_local_impl)->Value(); else aValue = SALOMEDS::AttributeName::_narrow(_corba_impl)->Value(); + + cout << "########################## Attribute Name = " << aValue << endl; return aValue.ToCString(); } diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx index a53e7b0df..f9365c23a 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx @@ -42,12 +42,14 @@ SALOMEDS_GenericAttribute::SALOMEDS_GenericAttribute(SALOMEDS::GenericAttribute_ } else { _local_impl = NULL; - _corba_impl = theGA; + _corba_impl = SALOMEDS::GenericAttribute::_duplicate(theGA); } } SALOMEDS_GenericAttribute::~SALOMEDS_GenericAttribute() -{} +{ + if(!_isLocal) CORBA::release(_corba_impl); +} void SALOMEDS_GenericAttribute::CheckLocked() { diff --git a/src/SALOMEDS/SALOMEDS_SObject.cxx b/src/SALOMEDS/SALOMEDS_SObject.cxx index eddd0ab18..a2c9392d9 100644 --- a/src/SALOMEDS/SALOMEDS_SObject.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject.cxx @@ -39,7 +39,7 @@ SALOMEDS_SObject::SALOMEDS_SObject(SALOMEDS::SObject_ptr theSObject) } else { _local_impl = NULL; - _corba_impl = theSObject; + _corba_impl = SALOMEDS::SObject::_duplicate(theSObject); } } @@ -52,6 +52,7 @@ SALOMEDS_SObject::SALOMEDS_SObject(const Handle(SALOMEDSImpl_SObject)& theSObjec SALOMEDS_SObject::~SALOMEDS_SObject() { + if(!_isLocal) CORBA::release(_corba_impl); } char* SALOMEDS_SObject::GetID() diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 519b56797..76cfc6306 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -62,7 +62,7 @@ SALOMEDS_Study::SALOMEDS_Study(SALOMEDS::Study_ptr theStudy) } else { _local_impl = NULL; - _corba_impl = theStudy; + _corba_impl = SALOMEDS::Study::_duplicate(theStudy); } init_orb(); @@ -70,6 +70,7 @@ SALOMEDS_Study::SALOMEDS_Study(SALOMEDS::Study_ptr theStudy) SALOMEDS_Study::~SALOMEDS_Study() { + if(!_isLocal) CORBA::release(_corba_impl); } char* SALOMEDS_Study::GetPersistentReference() diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx b/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx index 2c6903c7e..e41799232 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx @@ -34,12 +34,13 @@ SALOMEDS_StudyBuilder::SALOMEDS_StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuild { _isLocal = false; _local_impl = NULL; - _corba_impl = theBuilder; + _corba_impl = SALOMEDS::StudyBuilder::_duplicate(theBuilder); init_orb(); } SALOMEDS_StudyBuilder::~SALOMEDS_StudyBuilder() { + if(!_isLocal) CORBA::release(_corba_impl); } SALOMEDSClient_SComponent* SALOMEDS_StudyBuilder::NewComponent(const char* ComponentDataType) diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.cxx b/src/SALOMEDS/SALOMEDS_StudyManager.cxx index 40576276e..9c6368fcd 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.cxx @@ -37,12 +37,13 @@ SALOMEDS_StudyManager::SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManag } else { _local_impl = NULL; - _corba_impl = theManager; + _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager); } } SALOMEDS_StudyManager::~SALOMEDS_StudyManager() { + if(!_isLocal) CORBA::release(_corba_impl); } SALOMEDSClient_Study* SALOMEDS_StudyManager::NewStudy(const char* study_name) -- 2.39.2