From: mpa Date: Tue, 25 Oct 2016 08:13:11 +0000 (+0300) Subject: Fix problem with waiting threads on server X-Git-Tag: Before_python3_27062017~1^2~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=781df619ff7409d44142fbd389da5fa6d925bd93;p=modules%2Fkernel.git Fix problem with waiting threads on server --- 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.