diff options
author | bala <balanatarajan@users.noreply.github.com> | 2001-11-08 19:59:41 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2001-11-08 19:59:41 +0000 |
commit | 470bc9900addb78afb22e2be962d9ad05a453c48 (patch) | |
tree | 64b66260513774a39dfbcdaedc813bfd6d3431e0 | |
parent | ba57d1be1b051f93392ab6f9232765dda29db9ed (diff) | |
download | ATCD-470bc9900addb78afb22e2be962d9ad05a453c48.tar.gz |
ChangeLogTag: Thu Nov 8 13:57:58 2001 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 21 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FaultTolerance.bor | 2 | ||||
-rw-r--r-- | TAO/tao/Asynch_Reply_Dispatcher.cpp | 12 | ||||
-rw-r--r-- | TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp | 12 | ||||
-rw-r--r-- | TAO/tao/Synch_Reply_Dispatcher.cpp | 12 |
5 files changed, 56 insertions, 3 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 1b91ae5b300..779ff86cdeb 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,24 @@ +Thu Nov 8 13:57:58 2001 Balachandran Natarajan <bala@cs.wustl.edu> + + * tao/Asynch_Reply_Dispatcher.cpp: + * tao/Synch_Reply_Dispatcher.cpp: + * tao/DynamicInterface/DII_Reply_Dispatcher.cpp (dispatch_reply): + Fixed a leak. The leak was occuring because of a unreleased + datablock. + + The Reply Dispatchers are created by the invocation object on + the stack for every invocation. Once the invocation is done, + destructor takes care of deleting the datablock into which the + incoming reply was copied, if it was created on the heap. There + was a subtle assumption made. That is, we assumed that the + object is created and destroyed for every invocation. Under + special conditions like the ones in BUGID 1029, the invocation + object reuses the same object across multiple invocations. This + leads to a memory leak as the old datablocks are not + deleted. This fixes BUGID 1029. + + * orbsvcs/orbsvcs/FaultTolerance.bor: Added the new files. + Wed Nov 7 13:20:50 2001 Chad Elliott <elliott_c@ociweb.com> * orbsvcs/orbsvcs/Trader/Offer_Database.cpp: diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance.bor b/TAO/orbsvcs/orbsvcs/FaultTolerance.bor index dff62321fe3..0b9c4ac8685 100644 --- a/TAO/orbsvcs/orbsvcs/FaultTolerance.bor +++ b/TAO/orbsvcs/orbsvcs/FaultTolerance.bor @@ -21,6 +21,8 @@ OBJFILES = \ $(OBJDIR)\FT_CORBAS.obj \ $(OBJDIR)\FT_IOGR_Property.obj \ $(OBJDIR)\FT_Policy_i.obj \ + $(OBJDIR)\FT_Endpoint_Selector_Factory.obj \ + $(OBJDIR)\FT_Invocation_Endpoint_Selectors.obj \ $(OBJDIR)\FT_PolicyFactory.obj \ $(OBJDIR)\FT_Service_Activate.obj \ $(OBJDIR)\FT_Service_Callbacks.obj \ diff --git a/TAO/tao/Asynch_Reply_Dispatcher.cpp b/TAO/tao/Asynch_Reply_Dispatcher.cpp index 23b8cb7abe1..7dc7e3aecd4 100644 --- a/TAO/tao/Asynch_Reply_Dispatcher.cpp +++ b/TAO/tao/Asynch_Reply_Dispatcher.cpp @@ -109,7 +109,17 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply ( this->reply_status_ = params.reply_status_; // Transfer the <params.input_cdr_>'s content to this->reply_cdr_ - (void) this->reply_cdr_.clone_from (params.input_cdr_); + ACE_Data_Block *db = + this->reply_cdr_.clone_from (params.input_cdr_); + + // See whether we need to delete the data block by checking the + // flags. We cannot be happy that we initally allocated the + // datablocks of the stack. If this method is called twice, as is in + // some cases where the same invocation object is used to make two + // invocations like forwarding, the release becomes essential. + if (ACE_BIT_DISABLED (db->flags (), + ACE_Message_Block::DONT_DELETE)) + db->release (); // Steal the buffer, that way we don't do any unnecesary copies of // this data. diff --git a/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp b/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp index 2ca74135dfe..ebad9ea91b5 100644 --- a/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp +++ b/TAO/tao/DynamicInterface/DII_Reply_Dispatcher.cpp @@ -55,7 +55,17 @@ TAO_DII_Deferred_Reply_Dispatcher::dispatch_reply ( this->reply_status_ = params.reply_status_; // Transfer the <params.input_cdr_>'s content to this->reply_cdr_ - (void) this->reply_cdr_.clone_from (params.input_cdr_); + ACE_Data_Block *db = + this->reply_cdr_.clone_from (params.input_cdr_); + + // See whether we need to delete the data block by checking the + // flags. We cannot be happy that we initally allocated the + // datablocks of the stack. If this method is called twice, as is in + // some cases where the same invocation object is used to make two + // invocations like forwarding, the release becomes essential. + if (ACE_BIT_DISABLED (db->flags (), + ACE_Message_Block::DONT_DELETE)) + db->release (); // Steal the buffer, that way we don't do any unnecesary copies of // this data. diff --git a/TAO/tao/Synch_Reply_Dispatcher.cpp b/TAO/tao/Synch_Reply_Dispatcher.cpp index 3d634d9da28..3d2f7ea3628 100644 --- a/TAO/tao/Synch_Reply_Dispatcher.cpp +++ b/TAO/tao/Synch_Reply_Dispatcher.cpp @@ -62,7 +62,17 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply ( //this->message_state_.reset (0); // Transfer the <params.input_cdr_>'s content to this->reply_cdr_ - (void) this->reply_cdr_.clone_from (params.input_cdr_); + ACE_Data_Block *db = + this->reply_cdr_.clone_from (params.input_cdr_); + + // See whether we need to delete the data block by checking the + // flags. We cannot be happy that we initally allocated the + // datablocks of the stack. If this method is called twice, as is in + // some cases where the same invocation object is used to make two + // invocations like forwarding, the release becomes essential. + if (ACE_BIT_DISABLED (db->flags (), + ACE_Message_Block::DONT_DELETE)) + db->release (); this->state_changed (TAO_LF_Event::LFS_SUCCESS); |