From 7e55c9b2d8e68356dec8b124cfedf89548baa109 Mon Sep 17 00:00:00 2001 From: fhunleth Date: Wed, 7 Feb 2001 04:41:48 +0000 Subject: ChangeLogTag: Tue Feb 6 22:39:06 2001 Frank Hunleth --- TAO/ChangeLogs/ChangeLog-02a | 7 +++++ TAO/tao/Connection_Cache_Manager.cpp | 57 +++++++++++++----------------------- 2 files changed, 27 insertions(+), 37 deletions(-) diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index b24149bdb38..3b03aba23e9 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,10 @@ +Tue Feb 6 22:39:06 2001 Frank Hunleth + + * tao/Connection_Cache_Manager.cpp: + Fixed core dump in close_i () that was being caused by + unbinding hash map entries while iterating over the + hash map. + Tue Feb 06 15:49:41 2001 Carlos O'Ryan * tao/TAO.dsw: diff --git a/TAO/tao/Connection_Cache_Manager.cpp b/TAO/tao/Connection_Cache_Manager.cpp index cbb96715c3c..4517ef283c1 100644 --- a/TAO/tao/Connection_Cache_Manager.cpp +++ b/TAO/tao/Connection_Cache_Manager.cpp @@ -221,52 +221,35 @@ TAO_Connection_Cache_Manager::make_idle_i (HASH_MAP_ENTRY *&entry) int TAO_Connection_Cache_Manager::close_i (ACE_Handle_Set &handle_set) { - - // We will loop twice - - // First we look through whether we have entries that have already - // been closed. If so we will just purge them from the map - for (HASH_MAP_ITER iter = this->cache_map_.begin (); iter != this->cache_map_.end (); ++iter) { - if ((*iter).int_id_.recycle_state () == ACE_RECYCLABLE_CLOSED) - { - HASH_MAP_ENTRY *entry = 0; - this->cache_map_.find ((*iter).ext_id_, - entry); + // First we look through whether we have an entry that has already + // been closed. - // Call the implementation directly. - this->purge_entry_i (entry); + if ((*iter).int_id_.recycle_state () != ACE_RECYCLABLE_CLOSED) + { + // As a first step, check whether the handler has been + // registered with the reactor. If registered, then get the + // handle and set that in the so that the ORB_Core + // would deregister them from the reactor before shutdown. - } - } + if ((*iter).int_id_.handler ()->is_registered ()) + { + handle_set.set_bit ((*iter).int_id_.handler ()->fetch_handle ()); + } - // In the second step do the management of the rest - for (HASH_MAP_ITER iter_i = this->cache_map_.begin (); - iter_i != this->cache_map_.end (); - ++iter_i) - { - // As a first step, check whether the handler has been - // registered with the reactor. If registered, then get the - // handle and set that in the so that the ORB_Core - // would deregister them from the reactor before shutdown. + // Inform the handler that has a reference to the entry in the + // map that we are *gone* now. So, the handler should not use + // the reference to the entry that he has, to acces us *at any + // time*. + (*iter).int_id_.handler ()->cache_map_entry (0); - if ((*iter_i).int_id_.handler ()->is_registered ()) - { - handle_set.set_bit ((*iter_i).int_id_.handler ()->fetch_handle ()); + // Then decrement the reference count on the handler + (*iter).int_id_.handler ()->decr_ref_count (); } - - // Inform the handler that has a reference to the entry in the - // map that we are *gone* now. So, the handler should not use - // the reference to the entry that he has, to acces us *at any - // time*. - (*iter_i).int_id_.handler ()->cache_map_entry (0); - - // Then decrement the reference count on the handler - (*iter_i).int_id_.handler ()->decr_ref_count (); - } + } // Unbind all the entries in the map this->cache_map_.unbind_all (); -- cgit v1.2.1