From bf26eec507fed8524368e523eadc5b798a40e870 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Sat, 20 Nov 2010 11:08:55 -0700 Subject: fix busy loop in uzbl-tabbed after closing a tab this is triggered by having a handler for SIGCHLD. using gobject.spawn_async instead of subprocess.Popen means we don't need a SIGCHLD handler to reap dead children. --- examples/data/scripts/uzbl-tabbed | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'examples') diff --git a/examples/data/scripts/uzbl-tabbed b/examples/data/scripts/uzbl-tabbed index 42837d3..9e5d715 100755 --- a/examples/data/scripts/uzbl-tabbed +++ b/examples/data/scripts/uzbl-tabbed @@ -158,7 +158,7 @@ import atexit import types from gobject import io_add_watch, source_remove, timeout_add, IO_IN, IO_HUP -from signal import signal, SIGTERM, SIGINT, SIGCHLD +from signal import signal, SIGTERM, SIGINT from optparse import OptionParser, OptionGroup from traceback import print_exc @@ -536,7 +536,6 @@ class UzblTabbed: self._timers = {} self._buffer = "" self._killed = False - self._processes = [] # A list of the recently closed tabs self._closed = [] @@ -656,9 +655,6 @@ class UzblTabbed: # Catch keyboard interrupts signal(SIGINT, lambda signum, stack_frame: self.terminate(SIGINT)) - # Catch SIGCHLD - signal(SIGCHLD, lambda signum, stack_frame: self.join_children()) - try: gtk.main() @@ -678,15 +674,6 @@ class UzblTabbed: raise - - def join_children(self): - '''Find and remove zombie children processes.''' - - for p in self._processes: - if p.poll() is not None: - self._processes.remove(p) - - def terminate(self, termsig=None): '''Handle termination signals and exit safely and cleanly.''' @@ -1017,7 +1004,7 @@ class UzblTabbed: cmd = ['uzbl-browser', '-n', name, '-s', str(sid), '--connect-socket', self.socket_path, '--uri', uri] - self._processes += [subprocess.Popen(cmd)] # TODO: do i need close_fds=True ? + gobject.spawn_async(cmd, flags=gobject.SPAWN_SEARCH_PATH) uzbl = UzblInstance(self, tab, name, uri, title, switch) SocketClient.instances_queue[name] = uzbl -- cgit v1.2.3