activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1420235 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels: ActiveMQConsumerKernel.cpp ActiveMQSessionKernel.cpp
Date Tue, 11 Dec 2012 15:53:16 GMT
Author: tabish
Date: Tue Dec 11 15:53:14 2012
New Revision: 1420235

URL: http://svn.apache.org/viewvc?rev=1420235&view=rev
Log:
Fix some memory that can occur when exceptions are thrown.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQSessionKernel.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp?rev=1420235&r1=1420234&r2=1420235&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQConsumerKernel.cpp
Tue Dec 11 15:53:14 2012
@@ -384,6 +384,7 @@ ActiveMQConsumerKernel::ActiveMQConsumer
     applyDestinationOptions(this->consumerInfo);
 
     if (this->consumerInfo->getPrefetchSize() < 0) {
+        delete this->internal;
         throw IllegalArgumentException(__FILE__, __LINE__, "Cannot create a consumer with
a negative prefetch");
     }
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQSessionKernel.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQSessionKernel.cpp?rev=1420235&r1=1420234&r2=1420235&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQSessionKernel.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/kernels/ActiveMQSessionKernel.cpp
Tue Dec 11 15:53:14 2012
@@ -234,7 +234,14 @@ ActiveMQSessionKernel::ActiveMQSessionKe
 
     // If the connection is already started, start the session.
     if (this->connection->isStarted()) {
-        this->start();
+        try {
+            this->start();
+        } catch (...) {
+            this->transaction.reset(NULL);
+            this->executor.reset(NULL);
+            delete this->config;
+            throw;
+        }
     }
 }
 



Mime
View raw message