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:18:07 GMT
Repository: activemq-cpp
Updated Branches:
  refs/heads/3.8.x 2c49018bd -> b8d5e03b0


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/b8d5e03b
Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/b8d5e03b
Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/b8d5e03b

Branch: refs/heads/3.8.x
Commit: b8d5e03b0072ccdaecb3bb6bfe654b14174b65b4
Parents: 2c49018
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:17:27 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/b8d5e03b/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 98f096a..7bf0cd1 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