activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1392926 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
Date Tue, 02 Oct 2012 14:26:00 GMT
Author: tabish
Date: Tue Oct  2 14:25:59 2012
New Revision: 1392926

URL: http://svn.apache.org/viewvc?rev=1392926&view=rev
Log:
Add small fix to ensure concurrent close from client and onException doesn't step into NULL
transport. 

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp?rev=1392926&r1=1392925&r2=1392926&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
Tue Oct  2 14:25:59 2012
@@ -297,9 +297,12 @@ namespace core{
                 // Mark this Connection as having a Failed transport.
                 this->connection->setFirstFailureError(ex);
 
-                try{
-                    this->config->transport->stop();
-                } catch(...) {
+                Pointer<Transport> transport = this->config->transport;
+                if (transport != NULL) {
+                    try {
+                        transport->stop();
+                    } catch(...) {
+                    }
                 }
 
                 this->config->brokerInfoReceived->countDown();
@@ -310,7 +313,7 @@ namespace core{
                 synchronized(&this->config->transportListeners) {
                     Pointer< Iterator<TransportListener*> > iter( this->config->transportListeners.iterator()
);
 
-                    while( iter->hasNext() ) {
+                    while (iter->hasNext()) {
                         try{
                             iter->next()->onException(ex);
                         } catch(...) {}



Mime
View raw message