From 781df619ff7409d44142fbd389da5fa6d925bd93 Mon Sep 17 00:00:00 2001 From: mpa Date: Tue, 25 Oct 2016 11:13:11 +0300 Subject: [PATCH] Fix problem with waiting threads on server --- src/SALOMEDS/SALOMEDS.cxx | 7 +++---- src/SALOMEDS/SALOMEDS_Server.cxx | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS.cxx b/src/SALOMEDS/SALOMEDS.cxx index 86cfc7996..6199d4fed 100644 --- a/src/SALOMEDS/SALOMEDS.cxx +++ b/src/SALOMEDS/SALOMEDS.cxx @@ -116,16 +116,15 @@ extern "C" // Activate the objects. This tells the POA that the objects are ready to accept requests. PortableServer::ObjectId_var aStudy_iid = root_poa->activate_object(aStudy_i); aStudy = aStudy_i->_this(); - - //give ownership to the poa : the object will be deleted by the poa - aStudy_i->_remove_ref(); namingService.Register(aStudy.in(), "/Study"); // Assign the value of the IOR in the study->root CORBA::String_var IORStudy = orb->object_to_string(aStudy); aStudy_i->GetImpl()->SetTransientReference((char*)IORStudy.in()); } - return new SALOMEDS_Study(aStudy_i->GetImpl()); + SALOMEDS_Study* study = new SALOMEDS_Study(aStudy_i->GetImpl()); + aStudy_i->_remove_ref(); + return study; } SALOMEDS_EXPORT diff --git a/src/SALOMEDS/SALOMEDS_Server.cxx b/src/SALOMEDS/SALOMEDS_Server.cxx index 2903a8217..a1e9a1af1 100644 --- a/src/SALOMEDS/SALOMEDS_Server.cxx +++ b/src/SALOMEDS/SALOMEDS_Server.cxx @@ -162,11 +162,12 @@ int main(int argc, char** argv) PortableServer::ObjectId_var myStudy_iid = poa->activate_object(myStudy_i); SALOMEDS::Study_var Study = myStudy_i->_this(); NS.Register(Study.in(), "/Study"); - myStudy_i->_remove_ref(); // Assign the value of the IOR in the study->root CORBA::String_var IORStudy = orb->object_to_string(Study); myStudy_i->GetImpl()->SetTransientReference((char*)IORStudy.in()); + + myStudy_i->_remove_ref(); // Obtain a POAManager, and tell the POA to start accepting // requests on its objects. -- 2.30.2