From 49aa2cd64ae82c7d36c30ff2f77ed76810025b1b Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Fri, 4 Mar 2005 17:44:10 +0000 Subject: ChangeLogTag:Fri Mar 04 09:26:46 2005 Ossama Othman --- TAO/tao/Collocated_Invocation.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'TAO/tao/Collocated_Invocation.cpp') diff --git a/TAO/tao/Collocated_Invocation.cpp b/TAO/tao/Collocated_Invocation.cpp index 6c3f17b6f1b..52ef23d2b0b 100644 --- a/TAO/tao/Collocated_Invocation.cpp +++ b/TAO/tao/Collocated_Invocation.cpp @@ -3,6 +3,7 @@ #include "ORB_Core.h" #include "Request_Dispatcher.h" #include "TAO_Server_Request.h" +#include "Stub.h" #include "operation_details.h" @@ -48,7 +49,9 @@ namespace TAO { if (strat == TAO_CS_THRU_POA_STRATEGY) { - TAO_ORB_Core * const orb_core = this->orb_core (); + // Perform invocations on the servant through the servant's ORB. + CORBA::ORB_var servant_orb = this->stub ()->servant_orb_ptr (); + TAO_ORB_Core * const orb_core = servant_orb->orb_core (); TAO_ServerRequest request (orb_core, this->details_, @@ -57,6 +60,13 @@ namespace TAO TAO_Request_Dispatcher * const dispatcher = orb_core->request_dispatcher (); + // Retain ownership of the servant's ORB_Core in case + // another thread attempts to destroy it (e.g. via + // CORBA::ORB::destroy()) before this thread complete the + // invocation. + orb_core->_incr_refcnt (); + TAO_ORB_Core_Auto_Ptr my_orb_core (orb_core); + dispatcher->dispatch (orb_core, request, this->forwarded_to_.out () -- cgit v1.2.1