From: Anthony Geay Date: Thu, 14 Aug 2014 06:53:33 +0000 (+0200) Subject: Deal with ref count server side. X-Git-Tag: V7_5_0a1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4b5dddd5103a6a9121dc80ac45de99f2504e17e1;p=modules%2Fkernel.git Deal with ref count server side. --- diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 5552a5df5..9cea0e440 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -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