From fa3b766166449ca082b04269b42ad083a28c099b Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 19 Oct 2010 18:03:07 +0000 Subject: Tue Oct 19 17:58:37 UTC 2010 Johnny Willemsen * ciao/Servants/Port_Activator_T.h: * ciao/Servants/Port_Activator_T.cpp: Fixed memory leaks * ciao/Servants/Session/Servant_Impl_T.h: Layout changes --- CIAO/ciao/Servants/Port_Activator_T.cpp | 23 +++++++++++------------ CIAO/ciao/Servants/Port_Activator_T.h | 8 ++++---- CIAO/ciao/Servants/Session/Servant_Impl_T.h | 10 +++++----- 3 files changed, 20 insertions(+), 21 deletions(-) (limited to 'CIAO/ciao/Servants') diff --git a/CIAO/ciao/Servants/Port_Activator_T.cpp b/CIAO/ciao/Servants/Port_Activator_T.cpp index d52b337b72a..8ef854f9e46 100644 --- a/CIAO/ciao/Servants/Port_Activator_T.cpp +++ b/CIAO/ciao/Servants/Port_Activator_T.cpp @@ -18,12 +18,12 @@ namespace CIAO const char *oid, const char *name, Port_Activator_Types::Type t, - EXEC *e, - CONTEXT *c, + typename EXEC::ptr_type e, + typename CONTEXT::ptr_type c, COMP_SERV *cc) : Port_Activator_i (oid, name, t) - , executor_ (e) - , context_ (c) + , executor_ (EXEC::_duplicate (e)) + , context_ (CONTEXT::_duplicate (c)) , comp_serv_ (cc) { } @@ -34,8 +34,7 @@ namespace CIAO typename COMP_SERV> void Port_Activator_T::deactivate ( - PortableServer::Servant servant, - CORBA::Boolean) + PortableServer::Servant servant, CORBA::Boolean) { SERVANT *s = dynamic_cast (servant); if (s) @@ -58,9 +57,9 @@ namespace CIAO // side. if (ACE_OS::strcmp (this->oid_.in (), str.in ()) == 0) { - if (this->executor_ == 0 && this->t_ == Port_Activator_Types::FACET) + if (EXEC::is_nil (this->executor_.in ()) && this->t_ == Port_Activator_Types::FACET) { - CORBA::Object_var tmp = + ::CORBA::Object_var tmp = this->comp_serv_->get_facet_executor (this->name_.in ()); this->executor_ = EXEC::_narrow (tmp.in ()); @@ -69,14 +68,14 @@ namespace CIAO SERVANT *s = 0; ACE_NEW_THROW_EX (s, - SERVANT (this->executor_, - this->context_), - CORBA::NO_MEMORY ()); + SERVANT (this->executor_.in (), + this->context_.in ()), + ::CORBA::NO_MEMORY ()); return s; } - throw CORBA::OBJECT_NOT_EXIST (); + throw ::CORBA::OBJECT_NOT_EXIST (); } } diff --git a/CIAO/ciao/Servants/Port_Activator_T.h b/CIAO/ciao/Servants/Port_Activator_T.h index a71ab29798c..461dffc6feb 100644 --- a/CIAO/ciao/Servants/Port_Activator_T.h +++ b/CIAO/ciao/Servants/Port_Activator_T.h @@ -47,8 +47,8 @@ namespace CIAO Port_Activator_T (const char *oid, const char *name, Port_Activator_Types::Type t, - EXEC *e, - CONTEXT *c, + typename EXEC::ptr_type e, + typename CONTEXT::ptr_type c, COMP_SERV *cs); /// Template method from the base class, please see the base class @@ -61,10 +61,10 @@ namespace CIAO private: /// The executor - EXEC *executor_; + typename EXEC::_var_type executor_; /// Context classes - CONTEXT *context_; + typename CONTEXT::_var_type context_; /// Component servant which created @c this COMP_SERV *comp_serv_; diff --git a/CIAO/ciao/Servants/Session/Servant_Impl_T.h b/CIAO/ciao/Servants/Session/Servant_Impl_T.h index 006058e4659..7b03a64774e 100644 --- a/CIAO/ciao/Servants/Session/Servant_Impl_T.h +++ b/CIAO/ciao/Servants/Session/Servant_Impl_T.h @@ -45,10 +45,10 @@ namespace CIAO { public: Session_Servant_Impl (EXEC * exe, - Components::CCMHome_ptr home, - const char * ins_name, - Home_Servant_Impl_Base *home_servant, - ::CIAO::Session_Container_ptr c); + Components::CCMHome_ptr home, + const char * ins_name, + Home_Servant_Impl_Base *home_servant, + ::CIAO::Session_Container_ptr c); virtual ~Session_Servant_Impl (void); @@ -78,7 +78,7 @@ namespace CIAO typename EXEC::_var_type executor_; /// Initialized in this constructor. - CONTEXT * context_; + CONTEXT* context_; const char * ins_name_; }; -- cgit v1.2.1