From 3a2b5b2ddfcf6efcd6cdf4b71c3eb67a124f67fd Mon Sep 17 00:00:00 2001 From: Arnaud Simon Date: Fri, 29 Feb 2008 14:36:38 +0000 Subject: Qpid-823: Dispatcher thread should be closed after consumers have been closed. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@632331 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/client/AMQSession.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java index 5a6d145295..e757747b7f 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java @@ -1774,11 +1774,6 @@ public abstract class AMQSession extends Closeable implements Session, QueueSess */ private void closeConsumers(Throwable error) throws JMSException { - if (_dispatcher != null) - { - _dispatcher.close(); - _dispatcher = null; - } // we need to clone the list of consumers since the close() method updates the _consumers collection // which would result in a concurrent modification exception final ArrayList clonedConsumers = new ArrayList(_consumers.values()); @@ -1797,6 +1792,11 @@ public abstract class AMQSession extends Closeable implements Session, QueueSess } } // at this point the _consumers map will be empty + if (_dispatcher != null) + { + _dispatcher.close(); + _dispatcher = null; + } } /** -- cgit v1.2.1