//! Retrieves the last created PyScriptNode instance with createPyScriptNode.
PyScriptNode getDefaultPyScriptNode(in string nodeName);
+
+ //! This method remove all refs of PyScriptNode servant objects stored in server.
+ /*!
+ * Previous scripts created on container may have been stored in a map. This method removes them. It then clean all the contexts dict attached to them.
+ */
+ void cleanAllPyScripts();
};
/*! \brief Interface of the %component.
delete _id;
if(_NS)
delete _NS;
- for(std::map<std::string,Engines::PyNode_var>::iterator it=_dftPyNode.begin();it!=_dftPyNode.end();it++)
- {
- Engines::PyNode_var tmpVar((*it).second);
- if(!CORBA::is_nil(tmpVar))
- tmpVar->UnRegister();
- }
- for(std::map<std::string,Engines::PyScriptNode_var>::iterator it=_dftPyScriptNode.begin();it!=_dftPyScriptNode.end();it++)
- {
- Engines::PyScriptNode_var tmpVar((*it).second);
- if(!CORBA::is_nil(tmpVar))
- tmpVar->UnRegister();
- }
+ cleanAllPyScripts();
}
//=============================================================================
oldNode->UnRegister();
(*it).second=node;
}
- if(!CORBA::is_nil(node))
- node->Register();
return node._retn();
}
else
}
}
+void Engines_Container_i::cleanAllPyScripts()
+{
+ for(std::map<std::string,Engines::PyNode_var>::iterator it=_dftPyNode.begin();it!=_dftPyNode.end();it++)
+ {
+ Engines::PyNode_var tmpVar((*it).second);
+ if(!CORBA::is_nil(tmpVar))
+ tmpVar->UnRegister();
+ }
+ _dftPyNode.clear();
+ for(std::map<std::string,Engines::PyScriptNode_var>::iterator it=_dftPyScriptNode.begin();it!=_dftPyScriptNode.end();it++)
+ {
+ Engines::PyScriptNode_var tmpVar((*it).second);
+ if(!CORBA::is_nil(tmpVar))
+ tmpVar->UnRegister();
+ }
+ _dftPyScriptNode.clear();
+}
+
//=============================================================================
/*! \brief Retrieves the last created PyScriptNode instance with createPyScriptNode.
*
Engines::PyNode_ptr createPyNode(const char* nodeName, const char* code);
Engines::PyNode_ptr getDefaultPyNode(const char *nodeName);
Engines::PyScriptNode_ptr createPyScriptNode(const char* nodeName, const char* code);
+ void cleanAllPyScripts();
Engines::PyScriptNode_ptr getDefaultPyScriptNode(const char *nodeName);
// --- local C++ methods