summaryrefslogtreecommitdiff
path: root/TAO/tao/Collocated_Invocation.cpp
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2005-03-04 17:44:10 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2005-03-04 17:44:10 +0000
commit49aa2cd64ae82c7d36c30ff2f77ed76810025b1b (patch)
tree9869eb82b74723e667ee9a7274b8e68aa9830773 /TAO/tao/Collocated_Invocation.cpp
parent69603a17be6d5b0fe4c473ae8fcb6a49db1b9b3b (diff)
downloadATCD-49aa2cd64ae82c7d36c30ff2f77ed76810025b1b.tar.gz
ChangeLogTag:Fri Mar 04 09:26:46 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/tao/Collocated_Invocation.cpp')
-rw-r--r--TAO/tao/Collocated_Invocation.cpp12
1 files changed, 11 insertions, 1 deletions
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 ()