diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2000-08-26 17:03:15 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2000-08-26 17:03:15 +0000 |
commit | 4ea56f7e77ff05142a61d87469d9247433fd2714 (patch) | |
tree | 32b351ea6498334eb708f5d24a1d66fe2609bd03 /ace/Service_Repository.cpp | |
parent | 8331cdc79f142a76df4f079dae1285e5bce90a24 (diff) | |
download | ATCD-4ea56f7e77ff05142a61d87469d9247433fd2714.tar.gz |
ChangeLogTag:Sat Aug 26 12:00:18 2000 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
Diffstat (limited to 'ace/Service_Repository.cpp')
-rw-r--r-- | ace/Service_Repository.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/ace/Service_Repository.cpp b/ace/Service_Repository.cpp index 198ac3c6830..41339bbcf0b 100644 --- a/ace/Service_Repository.cpp +++ b/ace/Service_Repository.cpp @@ -171,8 +171,8 @@ ACE_Service_Repository::close (void) { ACE_Service_Type *s = ACE_const_cast (ACE_Service_Type *, this->service_vector_[i]); - delete s; --this->current_size_; + delete s; } delete [] this->service_vector_; @@ -326,23 +326,23 @@ int ACE_Service_Repository::remove (const ACE_TCHAR name[]) { ACE_TRACE ("ACE_Service_Repository::remove"); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); - - int i = this->find_i (name, 0, 0); - - if (i == -1) - return -1; - - ACE_Service_Type *s = ACE_const_cast (ACE_Service_Type *, - this->service_vector_[i]); + ACE_Service_Type *s = 0; + { + ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); + int i = this->find_i (name, 0, 0); + + if (i == -1) + return -1; + + s = ACE_const_cast (ACE_Service_Type *, + this->service_vector_[i]); + --this->current_size_; + + if (this->current_size_ >= 1) + this->service_vector_[i] + = this->service_vector_[this->current_size_]; + } delete s; - - --this->current_size_; - - if (this->current_size_ >= 1) - this->service_vector_[i] - = this->service_vector_[this->current_size_]; - return 0; } |