From 35bb716b15085518960926d9b4cbe0a03c609645 Mon Sep 17 00:00:00 2001 From: billh Date: Thu, 2 Dec 2004 12:17:11 +0000 Subject: [PATCH] Patch from Padraig O'Briain to fix 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 | 8 ++++++++ atk-bridge/bridge.c | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 19f119c..9896905 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-12-02 Bill Haneman + + Patch from Padraig O'Briain + * 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 * idl/Accessibility_LoginHelper.idl: diff --git a/atk-bridge/bridge.c b/atk-bridge/bridge.c index 6161b19..45155e0c 100644 --- a/atk-bridge/bridge.c +++ b/atk-bridge/bridge.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -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. -- 2.7.4