activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq-cpp git commit: Apply patch from: https://issues.apache.org/jira/browse/AMQCPP-562
Date Thu, 29 Jan 2015 15:16:40 GMT
Repository: activemq-cpp
Updated Branches:
  refs/heads/trunk 22c35e717 -> 78669b739


Apply patch from: https://issues.apache.org/jira/browse/AMQCPP-562

Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/78669b73
Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/78669b73
Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/78669b73

Branch: refs/heads/trunk
Commit: 78669b739103386e6c89cd63faef898e375452fa
Parents: 22c35e7
Author: Timothy Bish <tabish121@gmail.com>
Authored: Thu Jan 29 10:08:22 2015 -0500
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Thu Jan 29 10:08:22 2015 -0500

----------------------------------------------------------------------
 activemq-cpp/src/main/decaf/util/ArrayList.h | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/78669b73/activemq-cpp/src/main/decaf/util/ArrayList.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/ArrayList.h b/activemq-cpp/src/main/decaf/util/ArrayList.h
index c3a1878..d833d95 100644
--- a/activemq-cpp/src/main/decaf/util/ArrayList.h
+++ b/activemq-cpp/src/main/decaf/util/ArrayList.h
@@ -170,11 +170,15 @@ namespace util {
     public:
 
         virtual void clear() {
-            delete [] this->elements;
-            this->curSize = 0;
-            this->capacity = 10;
-            this->elements = new E[this->capacity];
-            AbstractList<E>::modCount++;
+            if (this->curSize > 0) {
+                delete [] this->elements;
+                this->curSize = 0;
+                this->capacity = 10;
+                this->elements = new E[this->capacity];
+                AbstractList<E>::modCount++;
+            } else {
+                ensureCapacity(10);
+            }
         }
 
         virtual bool isEmpty() const {


Mime
View raw message