summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-02-07 04:41:48 +0000
committerfhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-02-07 04:41:48 +0000
commit7e55c9b2d8e68356dec8b124cfedf89548baa109 (patch)
tree3c1c145327ed1e3a6718968e1601cf304d3d5a91
parent55a09fd46c89b93a3a43d56330d3635ed6787fe6 (diff)
downloadATCD-7e55c9b2d8e68356dec8b124cfedf89548baa109.tar.gz
ChangeLogTag: Tue Feb 6 22:39:06 2001 Frank Hunleth <fhunleth@cs.wustl.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a7
-rw-r--r--TAO/tao/Connection_Cache_Manager.cpp57
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 <fhunleth@cs.wustl.edu>
+
+ * 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 <coryan@uci.edu>
* 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 <handle_set> 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 <handle_set> 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 ();