activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1364823 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h
Date Mon, 23 Jul 2012 22:20:06 GMT
Author: tabish
Date: Mon Jul 23 22:20:06 2012
New Revision: 1364823

URL: http://svn.apache.org/viewvc?rev=1364823&view=rev
Log:
Fix a memory leak in the entry iterator

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h?rev=1364823&r1=1364822&r2=1364823&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/HashMap.h Mon Jul 23 22:20:06
2012
@@ -196,7 +196,9 @@ namespace util {
 
                 if (prevEntry == NULL){
                     int index = currentEntry->origKeyHash & (associatedMap->elementData.length()
- 1);
+                    HashMapEntry* removed = associatedMap->elementData[index];
                     associatedMap->elementData[index] = associatedMap->elementData[index]->next;
+                    delete removed;
                 } else {
                     prevEntry->next = currentEntry->next;
                 }



Mime
View raw message