summaryrefslogtreecommitdiff
path: root/TAO/tao/Sequence_T.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/Sequence_T.cpp')
-rw-r--r--TAO/tao/Sequence_T.cpp48
1 files changed, 8 insertions, 40 deletions
diff --git a/TAO/tao/Sequence_T.cpp b/TAO/tao/Sequence_T.cpp
index 2c7bbb97fce..a78e7aa8e10 100644
--- a/TAO/tao/Sequence_T.cpp
+++ b/TAO/tao/Sequence_T.cpp
@@ -636,23 +636,11 @@ TAO_Abstract_Manager<T,T_var,T_life>::operator= (
if (this->release_)
{
- if (*this->ptr_ != 0)
- {
- (*this->ptr_)->_remove_ref ();
- }
-
- *this->ptr_ = *rhs.ptr_;
-
- if (*this->ptr_ != 0)
- {
- (*this->ptr_)->_add_ref ();
- }
- }
- else
- {
- *this->ptr_ = *rhs.ptr_;
+ T_life::tao_release (*this->ptr_);
+ T_life::tao_duplicate (*rhs->ptr_);
}
+ *this->ptr_ = *rhs.ptr_;
return *this;
}
@@ -666,18 +654,10 @@ TAO_Abstract_Manager<T,T_var,T_life>::operator= (T * p)
// that of a var variable. Therefore we will not duplicate the
// user provided pointer before assigning it to the internal
// variable.
- if (*this->ptr_ != 0)
- {
- (*this->ptr_)->_remove_ref ();
- }
-
- *this->ptr_ = p;
- }
- else
- {
- *this->ptr_ = p;
+ T_life::tao_release (*this->ptr_);
}
+ *this->ptr_ = p;
return *this;
}
@@ -691,23 +671,11 @@ TAO_Abstract_Manager<T,T_var,T_life>::operator= (const T_var & p)
// that of a var variable. Therefore we duplicate p's
// pointer before assigning it to the internal
// variable.
- if (*this->ptr_ != 0)
- {
- (*this->ptr_)->_remove_ref ();
- }
-
- *this->ptr_ = p.in ();
-
- if (p != 0)
- {
- p->_add_ref ();
- }
- }
- else
- {
- *this->ptr_ = p.in ();
+ T_life::tao_release (*this->ptr_);
+ T_life::tao_duplicate (p.in ());
}
+ *this->ptr_ = p.in ();
return *this;
}