Skip to content

Commit

Permalink
fire the child reaper's quit callback only once
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@8249 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 13, 2014
1 parent 10cd536 commit dac1b7f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/xpra/scripts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def deadly_signal(signum, frame):
# child to exit and us to receive the SIGCHLD before our fork() returns (and
# thus before we even know the pid of the child). So be careful:
class ChildReaper(object):
#note: the quit callback will fire only once!
def __init__(self, quit_cb):
self._quit = quit_cb
self._children_pids = {}
Expand Down Expand Up @@ -112,7 +113,10 @@ def check(self):
self.add_dead_pid(pid)
self._logger("check() pids=%s, dead_pids=%s", pids, self._dead_pids)
if pids.issubset(self._dead_pids):
self._quit()
cb = self._quit
if cb:
self._quit = None
cb()
return False
return True

Expand Down

0 comments on commit dac1b7f

Please sign in to comment.