aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2010-11-20 11:08:55 -0700
committerGravatar Brendan Taylor <whateley@gmail.com>2010-11-20 11:08:55 -0700
commitbf26eec507fed8524368e523eadc5b798a40e870 (patch)
tree2f620a5ddd4f2437ba56e9f9b24f90894e9c0c43 /examples
parent117ecbb84f1851b0029239731af2f09786dddb08 (diff)
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.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/data/scripts/uzbl-tabbed17
1 files changed, 2 insertions, 15 deletions
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