// 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
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.