summaryrefslogtreecommitdiff
path: root/TAO/tao/Any.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/Any.cpp')
-rw-r--r--TAO/tao/Any.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/TAO/tao/Any.cpp b/TAO/tao/Any.cpp
index b1bc9961bce..46ac282d6c9 100644
--- a/TAO/tao/Any.cpp
+++ b/TAO/tao/Any.cpp
@@ -548,16 +548,6 @@ TAO::Unknown_IDL_Type::assign_translator (CORBA::TCKind kind,
// ****************************************************************
-CORBA::Any_var::Any_var (const CORBA::Any_var &r)
- : ptr_ (0)
-{
- if (r.ptr_ != 0)
- {
- ACE_NEW (this->ptr_,
- CORBA::Any (*r.ptr_));
- }
-}
-
CORBA::Any_var &
CORBA::Any_var::operator= (CORBA::Any *p)
{
@@ -573,16 +563,14 @@ CORBA::Any_var::operator= (CORBA::Any *p)
CORBA::Any_var &
CORBA::Any_var::operator= (const CORBA::Any_var &r)
{
- delete this->ptr_;
- this->ptr_ = 0;
+ CORBA::Any_ptr tmp = 0;
- if (r.ptr_ != 0)
- {
- ACE_NEW_RETURN (this->ptr_,
- CORBA::Any (*r.ptr_),
- *this);
- }
+ ACE_NEW_RETURN (tmp,
+ CORBA::Any (*r.ptr_),
+ *this);
+ delete this->ptr_;
+ this->ptr_ = tmp;
return *this;
}