diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-04-07 18:46:11 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-04-07 18:46:11 +0000 |
commit | 23f41890f4a412996066e7d970ffba76008b4df1 (patch) | |
tree | 2fb15bb8d39ffc0429efc840e06e4513bca86668 /ace/Service_Repository.cpp | |
parent | 3ca5b495c5e246ee7aea087416aa24ec448e42da (diff) | |
download | ATCD-23f41890f4a412996066e7d970ffba76008b4df1.tar.gz |
Made sure find() never returns fini'ed service.
Diffstat (limited to 'ace/Service_Repository.cpp')
-rw-r--r-- | ace/Service_Repository.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ace/Service_Repository.cpp b/ace/Service_Repository.cpp index d7217bde3f1..0db2df28a47 100644 --- a/ace/Service_Repository.cpp +++ b/ace/Service_Repository.cpp @@ -134,17 +134,15 @@ ACE_Service_Repository::fini (void) // remove services, so typically they are deleted in reverse // order. - for (this->current_size_--; - this->current_size_ >= 0; - this->current_size_--) + for (int i = this->current_size_ - 1; i >= 0; i--) { if (ACE::debug ()) ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("finalizing %s\n"), - this->service_vector_[this->current_size_]->name ())); + this->service_vector_[i]->name ())); ACE_Service_Type *s = ACE_const_cast (ACE_Service_Type *, - this->service_vector_[this->current_size_]); + this->service_vector_[i]); s->fini (); } } @@ -213,6 +211,11 @@ ACE_Service_Repository::find_i (const ASYS_TCHAR name[], { if (srp != 0) *srp = this->service_vector_[i]; + if ((*srp)->fini_called ()) + { + *srp = 0; + return -1; + } if (ignore_suspended && this->service_vector_[i]->active () == 0) return -2; |