diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-05-01 22:34:35 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-05-01 22:34:35 +0000 |
commit | 0dce05093f1b82888fa71160933618aaf158adad (patch) | |
tree | dc1b76886838b329c3fd38206284a486499a6015 /ace/Object_Manager.cpp | |
parent | 208382b5736f68db27f6ada470c621cf91be183f (diff) | |
download | ATCD-0dce05093f1b82888fa71160933618aaf158adad.tar.gz |
reverted last change because it causes a seg fault on NT.
Diffstat (limited to 'ace/Object_Manager.cpp')
-rw-r--r-- | ace/Object_Manager.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/ace/Object_Manager.cpp b/ace/Object_Manager.cpp index cb60445bb6f..6f7c39d9f5c 100644 --- a/ace/Object_Manager.cpp +++ b/ace/Object_Manager.cpp @@ -268,8 +268,6 @@ ACE_Object_Manager::ACE_Object_Manager (void) ACE_Object_Manager::~ACE_Object_Manager (void) { - if (dynamically_allocated_) - dynamically_allocated_ = 0; // Don't delete this again in fini() fini (); } @@ -286,7 +284,11 @@ ACE_Object_Manager::instance (void) ACE_NEW_RETURN (instance_pointer, ACE_Object_Manager, 0); ACE_ASSERT (instance_pointer == instance_); + +#if defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER) instance_pointer->dynamically_allocated_ = 1; +#endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER */ + return instance_pointer; } else @@ -673,23 +675,14 @@ ACE_Object_Manager::fini (void) if (ACE_OS_Object_Manager::instance_) ACE_OS_Object_Manager::instance_->fini (); - // If this was dynamically allocated by ACE (most likely in instance()) - // then delete it now. Further, the only way the <dynamically_allocated_> - // can be set is by way of ACE_Object_Manager::instance(). So if the - // <dynamically_allocated_> flag is set, it's the instance, so mark it gone. - // If it's not dynamically created, then it could still be the singleton - // instance if it was created on a stack, or statically. So if it is - // the singleton, mark it as gone as we are likely here as a result - // of a call from the dtor. +#if defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER) if (dynamically_allocated_) { - instance_ = 0; // Need to do this first to prevent recursion - delete this; - } - else if (instance_ == this) - { - instance_ = 0; + delete instance_; } +#endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER */ + + instance_ = 0; return 0; } |