From commits-return-20239-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Thu Oct 4 15:07:24 2012 Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A8FBDA77 for ; Thu, 4 Oct 2012 15:07:24 +0000 (UTC) Received: (qmail 3479 invoked by uid 500); 4 Oct 2012 15:07:24 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 3447 invoked by uid 500); 4 Oct 2012 15:07:24 -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 3439 invoked by uid 99); 4 Oct 2012 15:07:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2012 15:07:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Thu, 04 Oct 2012 15:07:23 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DC32923888EA for ; Thu, 4 Oct 2012 15:06:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1394110 - /activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp Date: Thu, 04 Oct 2012 15:06:39 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121004150639.DC32923888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Thu Oct 4 15:06:39 2012 New Revision: 1394110 URL: http://svn.apache.org/viewvc?rev=1394110&view=rev Log: fix for: https://issues.apache.org/jira/browse/AMQCPP-432 Modified: activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp Modified: activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp?rev=1394110&r1=1394109&r2=1394110&view=diff ============================================================================== --- activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp (original) +++ activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp Thu Oct 4 15:06:39 2012 @@ -199,6 +199,13 @@ namespace core{ this->scheduler->start(); } + ~ConnectionConfig() { + try { + this->scheduler->shutdown(); + } + AMQ_CATCHALL_NOTHROW() + } + void waitForBrokerInfo() { this->brokerInfoReceived->await(); } @@ -474,6 +481,24 @@ void ActiveMQConnection::close() { } } + // Ensure that interruption processing completes in case any consumers were + // still in the process when we closed them. + try { + Pointer latch = this->config->transportInterruptionProcessingComplete; + if (latch != NULL) { + int count = latch->getCount(); + for (; count > 0; count--) { + latch->countDown(); + } + } + } catch (Exception& error) { + if (!hasException) { + ex = error; + ex.setMark(__FILE__, __LINE__); + hasException = true; + } + } + // Once current deliveries are done this stops the delivery // of any new messages. this->started.set(false);