diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp index da23f4a93b1..750d892304e 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.cpp @@ -282,13 +282,23 @@ TAO_ECG_Mcast_Gateway::validate_configuration (void) TAO_ECG_Refcounted_Endpoint TAO_ECG_Mcast_Gateway::init_endpoint (void) { - TAO_ECG_Refcounted_Endpoint endpoint; + TAO_ECG_UDP_Out_Endpoint* endpoint = 0; + TAO_ECG_Refcounted_Endpoint refendpoint; - ACE_NEW_RETURN (endpoint, - TAO_ECG_UDP_Out_Endpoint, - endpoint); + // Try to allocate a new endpoint from the heap + ACE_NEW_NORETURN (endpoint, + TAO_ECG_UDP_Out_Endpoint); - ACE_SOCK_Dgram& dgram = endpoint->dgram (); + if (endpoint != 0) + { + refendpoint = endpoint; + } + else + { + return TAO_ECG_Refcounted_Endpoint (); + } + + ACE_SOCK_Dgram& dgram = refendpoint->dgram (); if (dgram.open (ACE_Addr::sap_any) == -1) { @@ -337,7 +347,7 @@ TAO_ECG_Mcast_Gateway::init_endpoint (void) return TAO_ECG_Refcounted_Endpoint (); } - return endpoint; + return refendpoint; } PortableServer::ServantBase * |