diff options
Diffstat (limited to 'TAO/tao/Environment.cpp')
-rw-r--r-- | TAO/tao/Environment.cpp | 60 |
1 files changed, 8 insertions, 52 deletions
diff --git a/TAO/tao/Environment.cpp b/TAO/tao/Environment.cpp index cf0713126d3..298581a24d8 100644 --- a/TAO/tao/Environment.cpp +++ b/TAO/tao/Environment.cpp @@ -47,8 +47,7 @@ CORBA_Environment::CORBA_Environment (const CORBA_Environment& rhs) previous_ (0) { // TAO_ORB_Core_instance ()->default_environment (this); - if (this->exception_) - this->exception_->_incr_refcnt (); + exception_->_incr_refcnt (); } CORBA_Environment::CORBA_Environment (TAO_ORB_Core* orb_core) @@ -59,27 +58,6 @@ CORBA_Environment::CORBA_Environment (TAO_ORB_Core* orb_core) } #endif -CORBA::ULong -CORBA_Environment::_incr_refcnt (void) -{ - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->refcount_lock_, 0); - return refcount_++; -} - -CORBA::ULong -CORBA_Environment::_decr_refcnt (void) -{ - { - ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->refcount_lock_, 0); - this->refcount_--; - if (this->refcount_ != 0) - return this->refcount_; - } - - delete this; - return 0; -} - CORBA_Environment& CORBA_Environment::operator= (const CORBA_Environment& rhs) { @@ -149,7 +127,13 @@ CORBA_Environment::default_environment () TAO_ORB_Core_instance ()->default_environment ()->clear (); #endif /* TAO_HAS_EXCEPTIONS */ - return CORBA::default_environment (); + return *TAO_ORB_Core_instance ()->default_environment (); +} + +CORBA_Environment& +CORBA::default_environment () +{ + return CORBA_Environment::default_environment (); } // Convenience -- say if the exception is a system exception or not. @@ -236,31 +220,3 @@ CORBA::Environment::print_exception (const char *info, ACE_DEBUG ((LM_ERROR, "TAO: (%P|%t) no exception\n")); } - -// ********************************************************* - -CORBA_Environment_var & -CORBA_Environment_var::operator= (CORBA_Environment_ptr p) -{ - if (this->ptr_ != p) - { - if (this->ptr_ != 0) - delete (this->ptr_); - - this->ptr_ = p; - } - return *this; -} - -CORBA_Environment_var & -CORBA_Environment_var::operator= (const CORBA_Environment_var &r) -{ - if (this->ptr_ != 0) - delete this->ptr_; - - this->ptr_ = new CORBA::Environment (*r.ptr_); - return *this; -} - - - |