diff options
author | vzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-11-29 14:52:02 +0000 |
---|---|---|
committer | vzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-11-29 14:52:02 +0000 |
commit | 18e6ab2b312e8ee366207001d0d98e93ae37d24b (patch) | |
tree | 833e1152f10b51ca67d6138ae80a5b2b8b200732 | |
parent | 83d7a6943a809816d6b5cfb0c0cc30814a289386 (diff) | |
download | ATCD-18e6ab2b312e8ee366207001d0d98e93ae37d24b.tar.gz |
ChangeLogTag: Thu Nov 29 14:46:49 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com>
-rw-r--r-- | TAO/ChangeLog | 9 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Root_POA.cpp | 48 |
2 files changed, 56 insertions, 1 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 8731e56080b..a8db69edb4e 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,10 @@ +Thu Nov 29 14:46:49 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * tao/PortableServer/Root_POA.cpp: + Fixed a memory leak described by Bug#3151. However, it's + difficult to provide an automated test for this bug since + it lies in refcounting of root POA. + Thu Nov 29 04:23:58 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com> * tests/DSI_AMH/Roundtrip.cpp: @@ -10,7 +17,7 @@ Wed Nov 28 12:59:33 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> * tests/Bug_3154_Regression/orbsvcs/CosNotification.idl: * tests/Bug_3154_Regression/test.idl: * tests/Bug_3154_Regression/run_test.pl: - Added $Id$ to these files to make fuzz check happy. + Added Id to these files to make fuzz check happy. Wed Nov 28 10:42:20 UTC 2007 Vladimir Zykov <vladimir.zykov@prismtech.com> diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index d9f2cd10b0f..53f4899dd47 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -319,9 +319,37 @@ TAO_Root_POA::~TAO_Root_POA (void) void TAO_Root_POA::complete_destruction_i (void) { + bool doing_complete_destruction = + this->waiting_destruction_ != 0; + // No longer awaiting destruction. this->waiting_destruction_ = 0; + PortableServer::POA_var poa; + TAO::ORT_Array my_array_obj_ref_template; + TAO::ORT_Adapter *ort_adapter; + if (doing_complete_destruction) + { + ort_adapter = + this->ORT_adapter_i (); + + // In case no ORT library is linked we get zero. + if (ort_adapter != 0) + { + // Get the ObjectReferenceTemplate. + PortableInterceptor::ObjectReferenceTemplate * const ort = + ort_adapter->get_adapter_template (); + + // Add it to the sequence of object reference templates, we + // just notify for ourselves that we are now non_existent, + // our childs will do it for themselves. + my_array_obj_ref_template.size (1); + my_array_obj_ref_template[0] = ort; + } + + poa = PortableServer::POA::_duplicate (this); + } + // Remove POA from the POAManager. int result = this->poa_manager_.remove_poa (this); @@ -361,6 +389,26 @@ TAO_Root_POA::complete_destruction_i (void) } ::CORBA::release (this); + + if (doing_complete_destruction) + { + this->adapter_state_ = PortableInterceptor::NON_EXISTENT; + + this->adapter_state_changed (my_array_obj_ref_template, + this->adapter_state_); + + if (ort_adapter != 0) + { + ort_adapter->release (my_array_obj_ref_template[0]); + + TAO::ORT_Adapter_Factory *ort_factory = + this->ORT_adapter_factory (); + + ort_factory->destroy (ort_adapter); + + this->ort_adapter_ = 0; + } + } } #if ! defined (CORBA_E_MICRO) |