]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Added CORBA::release to destrutors
authorsrn <srn@opencascade.com>
Wed, 6 Apr 2005 11:56:40 +0000 (11:56 +0000)
committersrn <srn@opencascade.com>
Wed, 6 Apr 2005 11:56:40 +0000 (11:56 +0000)
src/SALOMEDS/SALOMEDS_AttributeName.cxx
src/SALOMEDS/SALOMEDS_GenericAttribute.cxx
src/SALOMEDS/SALOMEDS_SObject.cxx
src/SALOMEDS/SALOMEDS_Study.cxx
src/SALOMEDS/SALOMEDS_StudyBuilder.cxx
src/SALOMEDS/SALOMEDS_StudyManager.cxx

index 37ec308a524d48188cfefe42592ff09051fef1f2..f3636add83778946b9b88f4bf0913ab2db1af2b3 100644 (file)
@@ -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();
 }
  
index a53e7b0df0d4f7c35f7a9660187b7dbda8424383..f9365c23a333bc46d6adece6314a9bc1693fdf86 100644 (file)
@@ -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() 
 {
index eddd0ab188962a5f30a75ffcd17a88c7ceec90d5..a2c9392d97c6e61667ec376070ca3367646e76ed 100644 (file)
@@ -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()
index 519b5679792396dfeac094c3d2f74d3970b5f714..76cfc63065dc740f748ce8196cecc97aad28452d 100644 (file)
@@ -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()
index 2c6903c7e8e41e96f8747021c5fbc5c4861cf1c3..e41799232ca2c7b7d226cc9bd7fbeade1cb82d86 100644 (file)
@@ -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)
index 40576276e6b93e8e5cc4e850e323aca674065018..9c6368fcdeb0b2413faf4a1d8bd24bdb65acc853 100644 (file)
@@ -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)