You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2008/09/01 01:52:17 UTC

svn commit: r690822 - /activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp

Author: tabish
Date: Sun Aug 31 16:52:17 2008
New Revision: 690822

URL: http://svn.apache.org/viewvc?rev=690822&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-165

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp?rev=690822&r1=690821&r2=690822&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp Sun Aug 31 16:52:17 2008
@@ -284,29 +284,28 @@
         sessionId->setConnectionId( connectionInfo.getConnectionId()->getValue() );
         sessionId->setValue( sessionIds.getNextSequenceId() );
         info->setSessionId( sessionId );
+
+        // Create and initialize the Connector's Session Info object, this will
+        // cleanup the SessionInfo command when destroyed.
         OpenWireSessionInfo* session = new OpenWireSessionInfo( this );
+        session->setSessionInfo( info );
+        session->setAckMode( ackMode );
 
         try{
 
             // Send the subscription message to the broker.
-            Response* response = syncRequest(info);
+            Response* response = syncRequest( info );
 
             // The broker did not return an error - this is good.
             // Just discard the response.
             delete response;
 
-            // Create the Connector Session Wrapper Object and fill in its
-            // data
-            session->setSessionInfo( info );
-            session->setAckMode( ackMode );
-
             // Return the session info.
             return session;
 
         } catch( ConnectorException& ex ) {
 
             // Something bad happened - free the session info object.
-            delete info;
             delete session;
 
             ex.setMark(__FILE__, __LINE__);
@@ -414,19 +413,16 @@
 
     } catch( ConnectorException& ex ) {
         delete consumer;
-        delete consumerInfo;
 
         ex.setMark( __FILE__, __LINE__ );
         throw ex;
     } catch( Exception& ex ) {
         delete consumer;
-        delete consumerInfo;
 
         ex.setMark( __FILE__, __LINE__ );
         throw OpenWireConnectorException( ex );
     } catch( ... ) {
         delete consumer;
-        delete consumerInfo;
 
         throw OpenWireConnectorException( __FILE__, __LINE__,
             "caught unknown exception" );