Added SIGCHLD handling to avoid zombie processes.
authorBruno Abinader <bruno.abinader@openbossa.org>
Tue, 23 Dec 2008 21:50:13 +0000 (21:50 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:24 +0000 (17:11 -0400)
FIXES:
 - Added SIGCHLD handling to avoid zombie processes.

Signed-off-by: Bruno Abinader <bruno.abinader@openbossa.org>
Acked-by: Anderson Briglia <anderson.briglia@openbossa.org>

git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1730 596f6dd7-e928-0410-a184-9e12fd12cf7e

purple.pyx

index 5de7e43..17411e7 100644 (file)
@@ -23,6 +23,7 @@ cdef extern from "c_purple.h":
     glib.guint glib_input_add(glib.gint fd, eventloop.PurpleInputCondition condition, eventloop.PurpleInputFunction function, glib.gpointer data)
 
 import ecore
+import signal
 
 cdef glib.GHashTable *c_ui_info
 
@@ -93,6 +94,12 @@ cdef class Purple:
         # adds glib iteration inside ecore main loop
         ecore.timer_add(0.001, self.__glib_iteration_when_idle)
 
+        # libpurple's built-in DNS resolution forks processes to perform
+        # blocking lookups without blocking the main process.  It does not
+        # handle SIGCHLD itself, so if the UI does not you quickly get an army
+        # of zombie subprocesses marching around.
+        signal.signal(signal.SIGCHLD, signal.SIG_IGN)
+
     def destroy(self):
         core.purple_core_quit()