[AMQ-9376] Fix ConcurrentModificationException during a destroy()

(cherry picked from commit 19696254dd)
This commit is contained in:
Matt Pavlovich 2023-11-07 08:12:46 -06:00 committed by JB Onofré
parent 96843d6c3f
commit 46667fbce1
1 changed files with 3 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.spring.SpringBrokerContext;
@ -182,7 +183,8 @@ public class ActiveMQServiceFactory implements ManagedServiceFactory {
}
synchronized public void destroy() {
for (String broker : brokers.keySet()) {
Set<String> tmpBrokersSet = brokers.keySet();
for (String broker : tmpBrokersSet) {
deleted(broker);
}
}