Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 37133 invoked from network); 27 May 2008 19:37:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 May 2008 19:37:04 -0000 Received: (qmail 45560 invoked by uid 500); 27 May 2008 19:37:06 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 45518 invoked by uid 500); 27 May 2008 19:37:06 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 45482 invoked by uid 99); 27 May 2008 19:37:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 May 2008 12:37:06 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 May 2008 19:36:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8DE7123889F3; Tue, 27 May 2008 12:36:43 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r660656 - /activemq/activemq-cpp/trunk/src/examples/main.cpp Date: Tue, 27 May 2008 19:36:42 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080527193643.8DE7123889F3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Tue May 27 12:36:40 2008 New Revision: 660656 URL: http://svn.apache.org/viewvc?rev=660656&view=rev Log: Fixing some issues with the tests Modified: activemq/activemq-cpp/trunk/src/examples/main.cpp Modified: activemq/activemq-cpp/trunk/src/examples/main.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/examples/main.cpp?rev=660656&r1=660655&r2=660656&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/examples/main.cpp (original) +++ activemq/activemq-cpp/trunk/src/examples/main.cpp Tue May 27 12:36:40 2008 @@ -74,6 +74,9 @@ } virtual void run() { + + ConnectionFactory* connectionFactory = NULL; + try { // Create a ConnectionFactory ConnectionFactory* connectionFactory = @@ -85,6 +88,7 @@ // free the factory, we are done with it. delete connectionFactory; + connectionFactory = NULL; // Create a Session if( this->sessionTransacted ) { @@ -123,6 +127,9 @@ } }catch ( CMSException& e ) { + delete connectionFactory; + connectionFactory = NULL; + e.printStackTrace(); } } @@ -204,15 +211,20 @@ virtual void run() { + ConnectionFactory* connectionFactory = NULL; + try { // Create a ConnectionFactory - ConnectionFactory* connectionFactory = + connectionFactory = ConnectionFactory::createCMSConnectionFactory( brokerURI ); // Create a Connection connection = connectionFactory->createConnection(); + delete connectionFactory; + connectionFactory = NULL; + connection->start(); connection->setExceptionListener(this); @@ -246,6 +258,13 @@ doneLatch.await( waitMillis ); } catch (CMSException& e) { + + // Indicate we are ready for messages. + latch.countDown(); + + delete connectionFactory; + connectionFactory = NULL; + e.printStackTrace(); } }