git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@666607 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-06-11 10:36:26 +00:00
parent 58e5b9acce
commit 32364744ee
1 changed files with 6 additions and 1 deletions

View File

@ -311,13 +311,18 @@ public abstract class AbstractRegion implements Region {
if (sub != null) { if (sub != null) {
// remove the subscription from all the matching queues. // remove the subscription from all the matching queues.
List<Destination> removeList = new ArrayList<Destination>();
synchronized (destinationsMutex) { synchronized (destinationsMutex) {
for (Iterator iter = destinationMap.get(info.getDestination()) for (Iterator iter = destinationMap.get(info.getDestination())
.iterator(); iter.hasNext();) { .iterator(); iter.hasNext();) {
Destination dest = (Destination) iter.next(); Destination dest = (Destination) iter.next();
dest.removeSubscription(context, sub); removeList.add(dest);
} }
} }
for(Destination dest:removeList) {
dest.removeSubscription(context, sub);
}
destroySubscription(sub); destroySubscription(sub);
} }