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 2012/10/04 17:06:39 UTC
svn commit: r1394110 -
/activemq/activemq-cpp/branches/activemq-cpp-3.4.x/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
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<CountDownLatch> 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);