Skip to content

Commit dac1b7f

Browse files
committed
fire the child reaper's quit callback only once
git-svn-id: https://xpra.org/svn/Xpra/trunk@8249 3bb7dfac-3a0b-4e04-842a-767bc560f471
1 parent 10cd536 commit dac1b7f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/xpra/scripts/server.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def deadly_signal(signum, frame):
6565
# child to exit and us to receive the SIGCHLD before our fork() returns (and
6666
# thus before we even know the pid of the child). So be careful:
6767
class ChildReaper(object):
68+
#note: the quit callback will fire only once!
6869
def __init__(self, quit_cb):
6970
self._quit = quit_cb
7071
self._children_pids = {}
@@ -112,7 +113,10 @@ def check(self):
112113
self.add_dead_pid(pid)
113114
self._logger("check() pids=%s, dead_pids=%s", pids, self._dead_pids)
114115
if pids.issubset(self._dead_pids):
115-
self._quit()
116+
cb = self._quit
117+
if cb:
118+
self._quit = None
119+
cb()
116120
return False
117121
return True
118122

0 commit comments

Comments
 (0)