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 15
15
16
16
import java .util .Collections ;
17
17
import java .util .HashSet ;
18
+ import java .util .Iterator ;
18
19
import java .util .Set ;
19
20
import java .util .concurrent .ConcurrentHashMap ;
20
21
@@ -76,14 +77,14 @@ public boolean stop(LifeCycle lifeCycle) {
76
77
public Set <LifeCycle > stopAll () {
77
78
Set <LifeCycle > stopped = new HashSet <>();
78
79
79
- for (LifeCycle lifeCycle : started ) {
80
+ for (Iterator <LifeCycle > iterator = started .iterator (); iterator .hasNext (); ) {
81
+ LifeCycle lifeCycle = iterator .next ();
80
82
if (lifeCycle .isStarted ()) {
81
83
lifeCycle .stop ();
82
84
stopped .add (lifeCycle );
83
85
}
86
+ iterator .remove ();
84
87
}
85
-
86
- started .clear ();
87
88
return Collections .unmodifiableSet (stopped );
88
89
}
89
90
You can’t perform that action at this time.
0 commit comments