Bug fix, kill_process() modifies the id <-> pid maps so to kill all ids one by one the loop iterator must be advanced before the kill.
This commit is contained in:
parent
30b16917ff
commit
3bd66217c6
|
@ -1375,8 +1375,11 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
else {
|
||||
/* Otherwise kill each process individually but don't wait on them yet */
|
||||
for(auto i : id_pid) {
|
||||
kill_process(i.first, false);
|
||||
auto i = id_pid.begin();
|
||||
auto iEnd = id_pid.end();
|
||||
while(i != iEnd) {
|
||||
// Must advance i before calling kill_process() which erases the entry at i
|
||||
kill_process((i++)->first, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue