diff options
-rw-r--r-- | TAO/ChangeLog-98c | 9 | ||||
-rw-r--r-- | TAO/tao/Sequence.h | 8 | ||||
-rw-r--r-- | TAO/tao/Sequence.i | 2 | ||||
-rw-r--r-- | TAO/tao/encode.cpp | 2 |
4 files changed, 14 insertions, 7 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 51833518249..f9687ee648f 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,12 @@ +Thu Jun 25 12:54:09 1998 Carlos O'Ryan <coryan@cs.wustl.edu> + + * tao/Sequence.h: + * tao/Sequence.i: + For octet sequences the method to obtain the underlying messsage + block was too expensive (it created a duplicate). This also + solve a memory leak in the operator<< for OutputCDR and octet + sequences. + Thu Jun 25 11:57:27 1998 Aniruddha Gokhale <gokhale@mambo.cs.wustl.edu> * TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp diff --git a/TAO/tao/Sequence.h b/TAO/tao/Sequence.h index f89606cc3ec..0f304b361f4 100644 --- a/TAO/tao/Sequence.h +++ b/TAO/tao/Sequence.h @@ -430,14 +430,12 @@ public: // = TAO extension ACE_Message_Block* mb (void) const; - // returns a duplicate of the underlying message block, it is the - // caller responsability to release the copy (IMHO this is - // consistent with the CORBA calling semantics, return values are - // owned by the caller). + // Returns the underlying message block, the caller must *not* + // release the copy. void replace (CORBA::ULong length, const ACE_Message_Block* mb); // Replaces the current buffer with <mb>, using only <length> bytes. - // It takes a duplicate of <mb>. + // It takes a duplicate of <mb> so the user still owns it. private: ACE_Message_Block* mb_; diff --git a/TAO/tao/Sequence.i b/TAO/tao/Sequence.i index ca46ba1dd34..93f5f40c6cd 100644 --- a/TAO/tao/Sequence.i +++ b/TAO/tao/Sequence.i @@ -287,7 +287,7 @@ TAO_Unbounded_Sequence<CORBA::Octet>::operator[] (CORBA::ULong i) const ACE_INLINE ACE_Message_Block* TAO_Unbounded_Sequence<CORBA::Octet>::mb (void) const { - return ACE_Message_Block::duplicate (this->mb_); + return this->mb_; } ACE_INLINE void diff --git a/TAO/tao/encode.cpp b/TAO/tao/encode.cpp index 344e1d3a359..012723d1a69 100644 --- a/TAO/tao/encode.cpp +++ b/TAO/tao/encode.cpp @@ -834,7 +834,7 @@ TAO_Marshal_Sequence::encode (CORBA::TypeCode_ptr tc, else { continue_encoding = continue_encoding && - stream->write_octet_array_mb (oseq->mb_); + stream->write_octet_array_mb (oseq->mb ()); } } #endif /* TAO_NO_COPY_OCTET_SEQUENCES */ |