]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Bug correction. Regitry server must be thread safe ; When components are instanciated... fbt/compilation_on_porthos fbt_compilation_on_porthos
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 29 Jan 2015 08:54:50 +0000 (09:54 +0100)
committerFlorian BRUNET <FB15EB3N@dsp0657834.(none)>
Thu, 12 Feb 2015 10:06:47 +0000 (11:06 +0100)
src/Registry/SALOME_Registry_Server.cxx

index 4ee6ea453e8c30ba9745f05c36380e933811ee54..d8adcd7dc7275b318cbf2ba46eaf657b645451d6 100644 (file)
@@ -170,7 +170,17 @@ int main( int argc , char **argv )
       RegistryService *ptrRegistry = SINGLETON_<RegistryService>::Instance() ;
       ptrRegistry->SessionName( ptrSessionName ) ;
       ptrRegistry->SetOrb(orb);
-      varComponents = ptrRegistry->_this() ;
+      //
+      CORBA::PolicyList policies;
+      policies.length(1);
+      PortableServer::ThreadPolicy_var threadPol(poa->create_thread_policy(PortableServer::SINGLE_THREAD_MODEL));
+      policies[0]=PortableServer::ThreadPolicy::_duplicate(threadPol);
+      PortableServer::POA_var poa2(poa->create_POA("SingleThPOA4SDS",manager,policies));
+      threadPol->destroy();
+      //
+      PortableServer::ObjectId_var id(poa2->activate_object(ptrRegistry));
+      CORBA::Object_var pipo=poa2->id_to_reference(id);
+      varComponents = Registry::Components::_narrow(pipo) ;
       ptrRegistry->_remove_ref(); //let poa manage registryservice deletion
       // The RegistryService must not already exist.