]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Deal with ref count server side.
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 14 Aug 2014 06:53:33 +0000 (08:53 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 14 Aug 2014 06:53:33 +0000 (08:53 +0200)
src/Container/Container_i.cxx

index 5552a5df55c5a4b5181f1152c1750556e6d6ce7d..9cea0e4407c0b7d81c2e041239330eb4a8f03cd5 100644 (file)
@@ -254,6 +254,10 @@ Engines_Container_i::~Engines_Container_i()
     delete _id;
   if(_NS)
     delete _NS;
+  if(!CORBA::is_nil(_dftPyNode))
+    _dftPyNode->UnRegister();
+  if(!CORBA::is_nil(_dftPyScriptNode))
+    _dftPyScriptNode->UnRegister();
 }
 
 //=============================================================================
@@ -1646,7 +1650,11 @@ Engines::PyNode_ptr Engines_Container_i::createPyNode(const char* nodeName, cons
       {
         CORBA::Object_var obj = _orb->string_to_object(astr.c_str());
         node = Engines::PyNode::_narrow(obj);
+        if(!CORBA::is_nil(_dftPyNode))
+          _dftPyNode->UnRegister();
         _dftPyNode = node;
+        if(!CORBA::is_nil(_dftPyNode))
+          _dftPyNode->Register();
         return node._retn();
       }
     else
@@ -1709,7 +1717,11 @@ Engines::PyScriptNode_ptr Engines_Container_i::createPyScriptNode(const char* no
       {
         CORBA::Object_var obj = _orb->string_to_object(astr.c_str());
         node = Engines::PyScriptNode::_narrow(obj);
+        if(!CORBA::is_nil(_dftPyScriptNode))
+          _dftPyScriptNode->UnRegister();
         _dftPyScriptNode = node;
+        if(!CORBA::is_nil(_dftPyScriptNode))
+          _dftPyScriptNode->Register();
         return node._retn();
       }
     else