mainloop: Only delete pid watch if we found the right pid
This commit is contained in:
1 parent
abfe17e2cb
commit
16f2f5f7e5
1 file changed
+2
-2
@@ -69,9 +69,9 @@ class Mainloop(object):
|
||||
to_delete_pids = []
|
||||
for pid in self._pid_watches:
|
||||
(opid, status) = os.waitpid(pid, os.WNOHANG)
|
||||
if opid != 0:
|
||||
if opid == pid:
|
||||
to_delete_pids.append(pid)
|
||||
self._pid_watches[pid](opid, status)
|
||||
self._pid_watches[pid](pid, status)
|
||||
for pid in to_delete_pids:
|
||||
del self._pid_watches[pid]
|
||||
newtime = time.time() * 1000
|
||||
|
||||
Reference in new issue
Block a user