summaryrefslogtreecommitdiff
path: root/TAO/tao/Object_Ref_Table.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/Object_Ref_Table.cpp')
-rw-r--r--TAO/tao/Object_Ref_Table.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/TAO/tao/Object_Ref_Table.cpp b/TAO/tao/Object_Ref_Table.cpp
index c1bfcadb7c4..a101a4d0b41 100644
--- a/TAO/tao/Object_Ref_Table.cpp
+++ b/TAO/tao/Object_Ref_Table.cpp
@@ -20,18 +20,9 @@ TAO_Object_Ref_Table::TAO_Object_Ref_Table (void)
TAO_Object_Ref_Table::~TAO_Object_Ref_Table (void)
{
- for (Iterator i = this->begin ();
- i != this->end ();
- ++i)
- {
- // Deallocate the id.
- CORBA::string_free (ACE_const_cast (char *, (*i).ext_id_));
+ this->destroy ();
- // Release the Object.
- CORBA::release ((*i).int_id_);
- }
-
- this->table_.close ();
+ this->table_.close (); // Only call close() in this destructor!
}
void
@@ -86,6 +77,21 @@ TAO_Object_Ref_Table::resolve_initial_references (
return this->find (id); // Returns a duplicate.
}
+void
+TAO_Object_Ref_Table::destroy (void)
+{
+ for (Iterator i = this->begin ();
+ i != this->end ();
+ ++i)
+ {
+ // Deallocate the id.
+ CORBA::string_free (ACE_const_cast (char *, (*i).ext_id_));
+
+ // Release the Object.
+ CORBA::release ((*i).int_id_);
+ }
+}
+
TAO_Object_Ref_Table::Iterator
TAO_Object_Ref_Table::begin (void)
{