-// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
{
if(!_launcher_singleton_ssl)
{
- int argc(0);
- CORBA::ORB_var orb = CORBA::ORB_init(argc,nullptr);
- PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa();
+ CORBA::ORB_var orb = KERNEL::GetRefToORB();
+ //[EDF26673] : do not release the POA object returned by _the_root_poa.
+ PortableServer::POA_ptr root_poa = PortableServer::POA::_the_root_poa();
+ PortableServer::POAManager_var pman = root_poa->the_POAManager();
+ CORBA::PolicyList policies;
+ policies.length(1);
+ PortableServer::ThreadPolicy_var threadPol(root_poa->create_thread_policy(PortableServer::SINGLE_THREAD_MODEL));
+ policies[0] = PortableServer::ThreadPolicy::_duplicate(threadPol);
+ PortableServer::POA_var safePOA = root_poa->create_POA("SingleThreadPOA",
+ pman,
+ policies);
+ threadPol->destroy();
SALOME_Fake_NamingService *ns=new SALOME_Fake_NamingService(orb);
- _launcher_singleton_ssl = new SALOME_Launcher(orb,root_poa,ns);//3rd arg is important to skip NS !
+ _launcher_singleton_ssl = new SALOME_Launcher(orb,safePOA,ns);//3rd arg is important to skip NS !
}
return _launcher_singleton_ssl;
}