summaryrefslogtreecommitdiff
path: root/TAO/tao/Generic_Sequence_T.h
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2009-01-19 19:40:14 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2009-01-19 19:40:14 +0000
commit7e7c731988f6240b0d32baf2e166c1724e760c51 (patch)
tree828582cd0788be9b77246020740caedd855af891 /TAO/tao/Generic_Sequence_T.h
parent3bb46c39ab4bb9fc9b06941d60adbbacfb0edad2 (diff)
downloadATCD-7e7c731988f6240b0d32baf2e166c1724e760c51.tar.gz
Mon Jan 19 19:37:24 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* tao/Generic_Sequence_T.h: When the sequence shrinks we release the members that are not available anymore by the user and then reinitialize them again. This solution works but can probably be improved with respect to performance and exception safety. This fixes bugzilla 3481 and 3548. * ace/Cache_Entries.h: * ace/Transport_Cache_Manager.h:
Diffstat (limited to 'TAO/tao/Generic_Sequence_T.h')
-rw-r--r--TAO/tao/Generic_Sequence_T.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/TAO/tao/Generic_Sequence_T.h b/TAO/tao/Generic_Sequence_T.h
index b3d64d8b10e..69fd49399e8 100644
--- a/TAO/tao/Generic_Sequence_T.h
+++ b/TAO/tao/Generic_Sequence_T.h
@@ -164,7 +164,7 @@ public:
/// Set a new length for the sequence
void length(CORBA::ULong length)
{
- if (length <= maximum_ || length <= length_)
+ if (length <= maximum_ || length <= length_)
{
if (buffer_ == 0)
{
@@ -172,7 +172,7 @@ public:
release_ = true;
}
- if (length_ < length)
+ if (length < length_)
{
// TODO This code does not provide the strong-exception
// guarantee, but it does provide the weak-exception
@@ -181,8 +181,10 @@ public:
// elements have been modified. One could argue that
// this problem is irrelevant, as the elements already
// modified are unreachable to conforming applications.
+ element_traits::release_range(
+ buffer_ + length, buffer_ + length_);
element_traits::initialize_range(
- buffer_ + length_, buffer_ + length);
+ buffer_ + length, buffer_ + length_);
}
length_ = length;
return;