File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/java/net/logstash/logback Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1515
1616import java .util .Collections ;
1717import java .util .HashSet ;
18+ import java .util .Iterator ;
1819import java .util .Set ;
1920import java .util .concurrent .ConcurrentHashMap ;
2021
@@ -76,14 +77,14 @@ public boolean stop(LifeCycle lifeCycle) {
7677 public Set <LifeCycle > stopAll () {
7778 Set <LifeCycle > stopped = new HashSet <>();
7879
79- for (LifeCycle lifeCycle : started ) {
80+ for (Iterator <LifeCycle > iterator = started .iterator (); iterator .hasNext (); ) {
81+ LifeCycle lifeCycle = iterator .next ();
8082 if (lifeCycle .isStarted ()) {
8183 lifeCycle .stop ();
8284 stopped .add (lifeCycle );
8385 }
86+ iterator .remove ();
8487 }
85-
86- started .clear ();
8788 return Collections .unmodifiableSet (stopped );
8889 }
8990
You can’t perform that action at this time.
0 commit comments