summaryrefslogtreecommitdiff
path: root/ace/Map_Manager.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-05-08 17:04:12 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-05-08 17:04:12 +0000
commitce49af958c8b39d39a86a6efa851dcabeb31b489 (patch)
treeaf796e3b46ddbae1c1de959b41c289a4c42fe0f4 /ace/Map_Manager.cpp
parent5dfc87f4054f105d2300a09b371b50da5aaacb42 (diff)
downloadATCD-ce49af958c8b39d39a86a6efa851dcabeb31b489.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Map_Manager.cpp')
-rw-r--r--ace/Map_Manager.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/ace/Map_Manager.cpp b/ace/Map_Manager.cpp
index c37691ab1a2..3b0ea0c5504 100644
--- a/ace/Map_Manager.cpp
+++ b/ace/Map_Manager.cpp
@@ -198,11 +198,13 @@ ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::open (size_t size,
this->allocator_ = alloc;
- // If we need to grow buffer, then remove the existing buffer.
- if (this->total_size_ < size)
- return this->resize_i (size);
- else
- return 0;
+ // This assertion is here to help track a situation that shouldn't happen
+ ACE_ASSERT (size != 0);
+
+ // Calling this->close_i () to ensure we release previous allocated
+ // memory before allocating new one.
+ this->close_i ();
+ return this->resize_i (size);
}
template <class EXT_ID, class INT_ID, class ACE_LOCK> int