activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r493730 - /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/expiration/ExpirationTest.cpp
Date Sun, 07 Jan 2007 14:38:04 GMT
Author: nmittler
Date: Sun Jan  7 06:38:03 2007
New Revision: 493730

URL: http://svn.apache.org/viewvc?view=rev&rev=493730
Log:
AMQCPP-28 - Applying patch for memory leak in ExpirationTest

Modified:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/expiration/ExpirationTest.cpp

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/expiration/ExpirationTest.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/expiration/ExpirationTest.cpp?view=diff&rev=493730&r1=493729&r2=493730
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/expiration/ExpirationTest.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/expiration/ExpirationTest.cpp
Sun Jan  7 06:38:03 2007
@@ -85,6 +85,7 @@
 class Producer : public Runnable {
 private:
 
+    ActiveMQConnectionFactory* connectionFactory;
     Connection* connection;
     Session* session;
     Topic* destination;
@@ -120,8 +121,7 @@
     virtual void run() {
         try {
             // Create a ConnectionFactory
-            ActiveMQConnectionFactory* connectionFactory = new
-                ActiveMQConnectionFactory("tcp://localhost:61613");
+            connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61613");
 
             // Create a Connection
             connection = connectionFactory->createConnection();
@@ -188,6 +188,11 @@
             if( connection != NULL ) delete connection;
         }catch ( CMSException& e ) {}
         connection = NULL;
+
+        try{
+            if( connectionFactory != NULL ) delete connectionFactory;
+        }catch ( CMSException& e ) {}
+        connectionFactory = NULL;
     }
 };
 



Mime
View raw message