diff options
author | iliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-08-30 17:55:17 +0000 |
---|---|---|
committer | iliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-08-30 17:55:17 +0000 |
commit | dd2b89d13857ad3e927607bf30a91f13e6d44235 (patch) | |
tree | 22f7fba4d40111306caa8cbdaa9fd3de813538a3 /ACE/ace/Service_Types.cpp | |
parent | cff7acd4c854559416250a3ad73416a473c4287a (diff) | |
download | ATCD-dd2b89d13857ad3e927607bf30a91f13e6d44235.tar.gz |
ChangeLogTag: Wed Aug 30 17:45:30 UTC 2006 Iliyan Jeliazkov <iliyan@ociweb.com>
Diffstat (limited to 'ACE/ace/Service_Types.cpp')
-rw-r--r-- | ACE/ace/Service_Types.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/ACE/ace/Service_Types.cpp b/ACE/ace/Service_Types.cpp index 77e733c9429..86ee6229bce 100644 --- a/ACE/ace/Service_Types.cpp +++ b/ACE/ace/Service_Types.cpp @@ -89,6 +89,7 @@ ACE_Service_Object_Type::ACE_Service_Object_Type (void *so, u_int f, ACE_Service_Object_Exterminator gobbler) : ACE_Service_Type_Impl (so, s_name, f, gobbler) + , initialized_ (-1) { ACE_TRACE ("ACE_Service_Object_Type::ACE_Service_Object_Type"); } @@ -105,8 +106,10 @@ ACE_Service_Object_Type::init (int argc, ACE_TCHAR *argv[]) const if (so == 0) return -1; - else - return so->init (argc, argv); + + this->initialized_ = so->init (argc, argv); + + return this->initialized_; } int @@ -119,18 +122,12 @@ ACE_Service_Object_Type::fini (void) const ACE_Service_Object * const so = static_cast<ACE_Service_Object *> (obj); - if (so) - { + // Call fini() if an only if, the object was successfuly + // initialized, i.e. init() returned 0. This is necessary to + // maintain the ctor/dtor-like semantics for init/fini. + if (so && initialized_ == 0) so->fini (); - // @TODO: Why is this disabled? -#if 0 - if (ACE_BIT_ENABLED (this->flags_, - ACE_Service_Type::DELETE_OBJ)) - delete so; -#endif /* 1 */ - } - return ACE_Service_Type_Impl::fini (); } |