activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r618999 - /activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/PooledSession.cpp
Date Wed, 06 Feb 2008 14:31:00 GMT
Author: nmittler
Date: Wed Feb  6 06:30:58 2008
New Revision: 618999

URL: http://svn.apache.org/viewvc?rev=618999&view=rev
Log:
AMQCPP-152 - Fixing memory leak of CachedProducers in CmsTemplate

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/PooledSession.cpp

Modified: activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/PooledSession.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/PooledSession.cpp?rev=618999&r1=618998&r2=618999&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/PooledSession.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/cmsutil/PooledSession.cpp Wed Feb  6 06:30:58
2008
@@ -32,6 +32,12 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 PooledSession::~PooledSession(){
+    
+    std::vector<CachedProducer*> cachedProducers = producerCache.getValues();
+    for( std::size_t ix = 0; ix < cachedProducers.size(); ++ix ) {
+        delete cachedProducers[ix];
+    }
+    cachedProducers.clear();
 }
 
 ////////////////////////////////////////////////////////////////////////////////



Mime
View raw message