Patch from Padraig O'Briain to fix
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 2 Dec 2004 12:17:11 +0000 (12:17 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 2 Dec 2004 12:17:11 +0000 (12:17 +0000)
SEGV in forked processes on exit (atk-bridge/bridge.c).

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@721 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
atk-bridge/bridge.c

index 19f119c..9896905 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-12-02  Bill Haneman <billh@gnome.org>
+
+       Patch from Padraig O'Briain <padraig.obriain@sun.com>
+       * atk-bridge/bridge.c:
+       (atk_bridge_init): Save the pid when we start, to detect forks.
+       (spi_atk_bridge_exit_func): Don't call the cleanup routines
+       if we're in a forked pid.
+       
 2004-10-09  Bill Haneman <billh@gnome.org>
 
        * idl/Accessibility_LoginHelper.idl:
index 6161b19..45155e0 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <string.h>
 #include <stdio.h>
+#include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <libbonobo.h>
@@ -108,6 +109,7 @@ extern void gnome_accessibility_module_init     (void);
 extern void gnome_accessibility_module_shutdown (void);
 
 static int     atk_bridge_initialized = FALSE;
+static pid_t   atk_bridge_pid = 0;
 static guint   atk_bridge_focus_tracker_id = 0;
 static guint   atk_bridge_key_event_listener_id = 0;
 static GArray *listener_ids = NULL;
@@ -154,6 +156,7 @@ atk_bridge_init (gint *argc, gchar **argv[])
       return 0;
     }
   atk_bridge_initialized = TRUE;
+  atk_bridge_pid = getpid ();
 
   if (g_getenv ("ATK_BRIDGE_REDIRECT_LOG"))
   {
@@ -484,6 +487,10 @@ spi_atk_bridge_exit_func (void)
       return;
     }
   this_app = NULL;
+  if (atk_bridge_pid != getpid ())
+    {
+      _exit (0);
+    }
 
   /*
    * Check whether we still have windows which have not been deleted.