SALOME_ContainerPerfLog::~SALOME_ContainerPerfLog()
{
- for(auto script : _scripts)
- {
- PortableServer::ServantBase *serv = getPOA()->reference_to_servant(script);
- PortableServer::ObjectId_var oid = getPOA()->reference_to_id(script);
- getPOA()->deactivate_object(oid);
- }
- _scripts.clear();
+ this->destroyInternal();
}
PortableServer::POA_var SALOME_ContainerPerfLog::getPOA()
return ret._retn();
}
+void SALOME_ContainerPerfLog::destroy()
+{
+ this->destroyInternal();
+}
+
+void SALOME_ContainerPerfLog::destroyInternal()
+{
+ _father->removeEntryBeforeDying( this );
+ for(auto script : _scripts)
+ {
+ PortableServer::ServantBase *serv = getPOA()->reference_to_servant(script);
+ PortableServer::ObjectId_var oid = getPOA()->reference_to_id(script);
+ getPOA()->deactivate_object(oid);
+ }
+ _scripts.clear();
+}
+
void SALOME_ContainerPerfLog::accept(SALOME_VisitorContainerLog &visitor)
{
visitor.enterContainerPerfLog( *this );
return CORBA::string_dup( _safe_logger_file_holder.getLastVersionOfFileNameLogger().c_str() );
}
+void SALOME_LogManager::removeEntryBeforeDying(SALOME_ContainerPerfLog *child)
+{
+ for(auto cont = _containers.begin() ; cont != _containers.end() ; ++cont )
+ {
+ PortableServer::ServantBase *serv = getPOA()->reference_to_servant(*cont);
+ SALOME_ContainerPerfLog *servCand = dynamic_cast<SALOME_ContainerPerfLog *>(serv);
+ if( servCand==child )
+ {
+ _containers.erase( cont );
+ break;
+ }
+ }
+}
+
///////////////////////
#include <cstdint>