Merge pull request #1108 from hyteio/AMQ-9376

[AMQ-9376] Fix ConcurrentModificationException during a destroy()
This commit is contained in:
JB Onofré 2023-11-09 14:04:31 +01:00 committed by GitHub
commit ca35e5921c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}
}