Fixed possible segmentation faults in StopAll()

This commit is contained in:
Thulinma 2013-01-14 14:52:49 +01:00
parent cddf0192f6
commit eb6c4ecbcb

View file

@ -518,8 +518,9 @@ void Util::Procs::Stop(pid_t name){
/// (Attempts to) stop all running child processes.
void Util::Procs::StopAll(){
std::map<pid_t, std::string> listcopy = plist;
std::map<pid_t, std::string>::iterator it;
for (it = plist.begin(); it != plist.end(); it++){
for (it = listcopy.begin(); it != listcopy.end(); it++){
Stop(( *it).first);
}
}