From 75ebaebcbf02241da125375973eafa202c91c774 Mon Sep 17 00:00:00 2001 From: irfan Date: Sat, 22 Aug 1998 05:38:30 +0000 Subject: *** empty log message *** --- ace/Service_Repository.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ace/Service_Repository.cpp') diff --git a/ace/Service_Repository.cpp b/ace/Service_Repository.cpp index 5fdea43218d..80e343f6faf 100644 --- a/ace/Service_Repository.cpp +++ b/ace/Service_Repository.cpp @@ -113,6 +113,28 @@ ACE_Service_Repository::ACE_Service_Repository (int size) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Service_Repository"))); } +// Finalize (call fini() and possibly delete) all the services. + +int +ACE_Service_Repository::fini (void) +{ + ACE_TRACE ("ACE_Service_Repository::close"); + ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, -1)); + + if (this->service_vector_ != 0) + { + // Make sure to fini the services in the reverse order in which + // they were added. + for (int i = this->current_size_ - 1; i >= 0; i--) + { + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("finalizing %s\n"), + this->service_vector_[i]->name ())); + ((ACE_Service_Type *)this->service_vector_[i])->fini (); + } + } + return 0; +} + // Close down all the services. int -- cgit v1.2.1