diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-03-01 18:54:41 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-03-01 18:54:41 +0000 |
commit | 0c1cb5388cad977ca409597ff32ef9d4a274bbf2 (patch) | |
tree | 8ef870090feb53d123032d9c133fa50ac33c4b84 | |
parent | 1f996ca4736eeda6075cf41f3182ee17b9bedecc (diff) | |
download | ATCD-0c1cb5388cad977ca409597ff32ef9d4a274bbf2.tar.gz |
ChangeLogTag: Wed Mar 1 12:47:41 2000 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 13 | ||||
-rw-r--r-- | TAO/tao/GIOP_Server_Request.cpp | 13 | ||||
-rw-r--r-- | TAO/tao/IORC.cpp | 18 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 13 | ||||
-rw-r--r-- | TAO/tao/Object_Adapter.cpp | 7 | ||||
-rw-r--r-- | TAO/tao/POA.cpp | 12 | ||||
-rw-r--r-- | TAO/tao/Policy_Manager.cpp | 12 | ||||
-rw-r--r-- | TAO/tao/decode.cpp | 28 |
8 files changed, 91 insertions, 25 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index bb9bc94a1b0..9b77a7cc369 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,16 @@ +Wed Mar 1 12:47:41 2000 Balachandran Natarajan <bala@cs.wustl.edu> + + * tao/Policy_Manager.cpp (get_policy_overrides): + * tao/GIOP_Server_Request.cpp: + * tao/POA.cpp: + * tao/decode.cpp: + * tao/Object_Adapter.cpp: + * tao/ORB.cpp: + * tao/IORC.cpp:Removed the naked "new" operators. This is for bug + #259. The bug refers only to ORB_Core, but other things were + also added to make things cleaner. BTW, it was also observed + that there were no naked new operators in ORB_Core.cpp. + Wed Mar 1 08:29:42 2000 Ossama Othman <ossama@uci.edu> * tao/default_resource.cpp: diff --git a/TAO/tao/GIOP_Server_Request.cpp b/TAO/tao/GIOP_Server_Request.cpp index 319c85ae203..5bd45d6e149 100644 --- a/TAO/tao/GIOP_Server_Request.cpp +++ b/TAO/tao/GIOP_Server_Request.cpp @@ -315,14 +315,17 @@ TAO_GIOP_ServerRequest::arguments (CORBA::NVList_ptr &list, void TAO_GIOP_ServerRequest::set_result (const CORBA::Any &value, - CORBA::Environment &ACE_TRY_ENV) + CORBA::Environment &ACE_TRY_ENV) { // setting a result when another result already exists or if an exception // exists is an error if (this->retval_ || this->exception_) ACE_THROW (CORBA::BAD_INV_ORDER ()); - this->retval_ = new CORBA::Any (value); + ACE_NEW_THROW_EX (this->retval_, + CORBA::Any (value), + CORBA::NO_MEMORY ()); + ACE_CHECK; } // Store the exception value. @@ -362,8 +365,10 @@ TAO_GIOP_ServerRequest::set_exception (const CORBA::Any &value, #endif /* TAO_HAS_MINIMUM_CORBA */ { - this->exception_ = new CORBA::Any (value); - + ACE_NEW_THROW_EX (this->exception_, + CORBA::Any (value), + CORBA::NO_MEMORY ()); + ACE_CHECK; this->exception_type_ = TAO_GIOP_USER_EXCEPTION; if (value.value ()) diff --git a/TAO/tao/IORC.cpp b/TAO/tao/IORC.cpp index f0e4083fe78..61107ab7a4a 100644 --- a/TAO/tao/IORC.cpp +++ b/TAO/tao/IORC.cpp @@ -454,7 +454,10 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul void operator<<= (CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList &_tao_elem) // copying { - TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList *_tao_any_val = new TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList (_tao_elem); + TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList *_tao_any_val = 0; + ACE_NEW (_tao_any_val, + TAO_IOP::TAO_IOR_Manipulation::EmptyProfileList (_tao_elem)); + if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -520,7 +523,10 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul void operator<<= (CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::NotFound &_tao_elem) // copying { - TAO_IOP::TAO_IOR_Manipulation::NotFound *_tao_any_val = new TAO_IOP::TAO_IOR_Manipulation::NotFound (_tao_elem); + TAO_IOP::TAO_IOR_Manipulation::NotFound *_tao_any_val = 0; + ACE_NEW (_tao_any_val, + TAO_IOP::TAO_IOR_Manipulation::NotFound (_tao_elem)); + if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -586,7 +592,9 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul void operator<<= (CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::Duplicate &_tao_elem) // copying { - TAO_IOP::TAO_IOR_Manipulation::Duplicate *_tao_any_val = new TAO_IOP::TAO_IOR_Manipulation::Duplicate (_tao_elem); + TAO_IOP::TAO_IOR_Manipulation::Duplicate *_tao_any_val = 0; + ACE_NEW (_tao_any_val, + TAO_IOP::TAO_IOR_Manipulation::Duplicate (_tao_elem)); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { @@ -652,7 +660,9 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, TAO_IOP::TAO_IOR_Manipul void operator<<= (CORBA::Any &_tao_any, const TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR &_tao_elem) // copying { - TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR *_tao_any_val = new TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR (_tao_elem); + TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR *_tao_any_val = 0; + ACE_NEW (_tao_any_val, + TAO_IOP::TAO_IOR_Manipulation::Invalid_IOR (_tao_elem)); if (!_tao_any_val) return; ACE_TRY_NEW_ENV { diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index c463c134d86..1741fe97d64 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -142,7 +142,11 @@ CORBA_ORB::InvalidName::_raise (void) // TAO extension - the _alloc method CORBA::Exception *CORBA::ORB::InvalidName::_alloc (void) { - return new CORBA::ORB::InvalidName; + CORBA::ORB::InvalidName *retval = 0; + ACE_NEW_RETURN (retval, + CORBA::ORB::InvalidName, + 0); + return retval; } CORBA_ORB::CORBA_ORB (TAO_ORB_Core *orb_core) @@ -303,7 +307,12 @@ CORBA_ORB::create_list (CORBA::Long count, for (CORBA::Long i=0; i < count; i++) { - CORBA::NamedValue_ptr nv = new CORBA::NamedValue; + CORBA::NamedValue_ptr nv = 0; + ACE_NEW_THROW_EX (nv, + CORBA::NamedValue, + CORBA::NO_MEMORY ()); + ACE_CHECK; + new_list->values_.enqueue_tail (nv); } } diff --git a/TAO/tao/Object_Adapter.cpp b/TAO/tao/Object_Adapter.cpp index 7d0421cffa6..b46c990226f 100644 --- a/TAO/tao/Object_Adapter.cpp +++ b/TAO/tao/Object_Adapter.cpp @@ -1095,8 +1095,13 @@ TAO_POA_Current_Impl::get_POA (CORBA::Environment &ACE_TRY_ENV) PortableServer::ObjectId * TAO_POA_Current_Impl::get_object_id (CORBA::Environment &) { + PortableServer::ObjectId *objid = 0; + // Create a new one and pass it back - return new PortableServer::ObjectId (this->object_id_); + ACE_NEW_RETURN (objid, + PortableServer::ObjectId (this->object_id_), + 0); + return objid; } TAO_ORB_Core & diff --git a/TAO/tao/POA.cpp b/TAO/tao/POA.cpp index 1cd9a8a920e..387326a8c97 100644 --- a/TAO/tao/POA.cpp +++ b/TAO/tao/POA.cpp @@ -1249,7 +1249,10 @@ TAO_POA::create_reference_i (const char *intf, { // Otherwise, it is the NON_RETAIN policy. Therefore, any ol' // object id will do (even an empty one). - system_id = new PortableServer::ObjectId; + ACE_NEW_THROW_EX (system_id, + PortableServer::ObjectId, + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); } // Create object key. @@ -1309,14 +1312,17 @@ TAO_POA::create_reference_with_id_i (const PortableServer::ObjectId &user_id, system_id.out ()) != 0) { ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - CORBA::Object::_nil ()); + CORBA::Object::_nil ()); } } else { // Otherwise, it is the NON_RETAIN policy. Therefore, user id // is the same as system id. - system_id = new PortableServer::ObjectId (user_id); + ACE_NEW_THROW_EX (system_id, + PortableServer::ObjectId (user_id), + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); } // Create object key. diff --git a/TAO/tao/Policy_Manager.cpp b/TAO/tao/Policy_Manager.cpp index 2fded2da609..57abe6b64d9 100644 --- a/TAO/tao/Policy_Manager.cpp +++ b/TAO/tao/Policy_Manager.cpp @@ -305,8 +305,16 @@ TAO_Policy_Manager_Impl::get_policy_overrides ( if (slots == 0) slots = this->count_; - CORBA::PolicyList_var policy_list = - new CORBA::PolicyList (slots); + + CORBA::PolicyList *policy_list_ptr; + + ACE_NEW_THROW_EX (policy_list_ptr, + CORBA::PolicyList (slots), + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (0); + + CORBA::PolicyList_var policy_list (policy_list_ptr); + policy_list->length (slots); CORBA::ULong n = 0; diff --git a/TAO/tao/decode.cpp b/TAO/tao/decode.cpp index 2b8c82e085c..867a7e9a6b5 100644 --- a/TAO/tao/decode.cpp +++ b/TAO/tao/decode.cpp @@ -355,11 +355,14 @@ TAO_Marshal_TypeCode::decode (CORBA::TypeCode_ptr, {TAO_ENCAP_BYTE_ORDER, 0}; // Bounded string. Save the bounds _oc_bounded_string [1] = (CORBA::Long) bound; - *tcp = new CORBA::TypeCode (ACE_static_cast(CORBA::TCKind, kind), - 8, - ACE_reinterpret_cast(char*,_oc_bounded_string), - 0, sizeof - (CORBA::String_var), 0); + ACE_NEW_THROW_EX (*tcp, + CORBA::TypeCode (ACE_static_cast(CORBA::TCKind, kind), + 8, + ACE_reinterpret_cast(char*,_oc_bounded_string), + 0, sizeof + (CORBA::String_var), 0), + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP); } } } @@ -455,12 +458,15 @@ TAO_Marshal_TypeCode::decode (CORBA::TypeCode_ptr, // reducing the cost of getting typecodes. if (continue_decoding) { - *tcp = new CORBA::TypeCode ((CORBA::TCKind) indir_kind, + ACE_NEW_THROW_EX (*tcp, + CORBA::TypeCode ((CORBA::TCKind) indir_kind, indir_len, indir_stream.rd_ptr(), 0, 0, - parent); + parent), + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP); } } break; @@ -487,12 +493,16 @@ TAO_Marshal_TypeCode::decode (CORBA::TypeCode_ptr, u_int len = (u_int) length; // create a new typecode - *tcp = new CORBA::TypeCode ((CORBA::TCKind) kind, + ACE_NEW_THROW_EX (*tcp, + CORBA::TypeCode ((CORBA::TCKind) kind, len, stream->rd_ptr (), 0, 0, - parent); + parent), + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (CORBA::TypeCode::TRAVERSE_STOP); + // skip length number of bytes in the stream, else we may // leave the stream in an undefined state (void) stream->skip_bytes (length); |