diff options
Diffstat (limited to 'TAO/tao/Synch_Invocation.cpp')
-rw-r--r-- | TAO/tao/Synch_Invocation.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp index 12847baf599..e0ad08a0a55 100644 --- a/TAO/tao/Synch_Invocation.cpp +++ b/TAO/tao/Synch_Invocation.cpp @@ -15,6 +15,7 @@ #include "tao/ORB_Core.h" #include "tao/Service_Context.h" #include "tao/SystemException.h" +#include "ace/Intrusive_Auto_Ptr.h" #if TAO_HAS_INTERCEPTORS == 1 # include "tao/PortableInterceptorC.h" @@ -55,8 +56,15 @@ namespace TAO { ACE_Countdown_Time countdown (max_wait_time); - TAO_Synch_Reply_Dispatcher rd (this->resolver_.stub ()->orb_core (), - this->details_.reply_service_info ()); + TAO_Synch_Reply_Dispatcher *rd_p = 0; + ACE_NEW_NORETURN (rd_p, TAO_Synch_Reply_Dispatcher (this->resolver_.stub ()->orb_core (), + this->details_.reply_service_info ())); + if (!rd_p) + { + throw ::CORBA::NO_MEMORY (); + } + + ACE_Intrusive_Auto_Ptr<TAO_Synch_Reply_Dispatcher> rd(rd_p, false); Invocation_Status s = TAO_INVOKE_FAILURE; @@ -101,7 +109,7 @@ namespace TAO // preallocated reply dispatcher. TAO_Bind_Dispatcher_Guard dispatch_guard ( this->details_.request_id (), - &rd, + rd.get (), transport->tms ()); if (dispatch_guard.status () != 0) @@ -163,7 +171,7 @@ namespace TAO // (explicitly coded) handlers called. We assume a POSIX.1c/C/C++ // environment. - s = this->wait_for_reply (max_wait_time, rd, dispatch_guard); + s = this->wait_for_reply (max_wait_time, *rd.get (), dispatch_guard); #if TAO_HAS_INTERCEPTORS == 1 if (s == TAO_INVOKE_RESTART) @@ -182,7 +190,7 @@ namespace TAO // What happens when the above call returns an error through // the return value? That would be bogus as per the contract // in the interface. The call violated the contract - s = this->check_reply_status (rd); + s = this->check_reply_status (*rd.get ()); // For some strategies one may want to release the transport // back to cache after receiving the reply. @@ -525,7 +533,7 @@ namespace TAO CORBA::ULong minor = 0; CORBA::ULong completion = 0; - if ((cdr >> minor) == 0 || (cdr >> completion) == 0) + if (!(cdr >> minor) || !(cdr >> completion)) { throw ::CORBA::MARSHAL (0, CORBA::COMPLETED_MAYBE); } |