2004-12-09 Padraig O'Briain <padraig.obriain@sun.com>
authorpadraigo <padraigo@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 9 Dec 2004 09:27:32 +0000 (09:27 +0000)
committerpadraigo <padraigo@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 9 Dec 2004 09:27:32 +0000 (09:27 +0000)
* atk-bridge/bridge.c (spi_atk_get_registry): Do not attempt to
restart registry process if the registry process is found to have died
and the current process is exiting.
(spi_atk_bridge_exit_func): Do not attempt to deregister the
application if the registry process has died.
(spi_atk_emit_eventv): Return if call to spi_atk_get_registry
does not return a registry object.
(spi_atk_tidy_windows): Give up if the registry process has died.

This fixes problems with hangs and crashes when logging out.

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

ChangeLog
atk-bridge/bridge.c

index 51062a3..f2a2c51 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2004-12-09  Padraig O'Briain <padraig.obriain@sun.com>
+
+       * atk-bridge/bridge.c (spi_atk_get_registry): Do not attempt to
+       restart registry process if the registry process is found to have died
+       and the current process is exiting.
+       (spi_atk_bridge_exit_func): Do not attempt to deregister the
+       application if the registry process has died.
+       (spi_atk_emit_eventv): Return if call to spi_atk_get_registry
+       does not return a registry object.
+       (spi_atk_tidy_windows): Give up if the registry process has died.
+
+       This fixes problems with hangs and crashes when logging out.
+
 2004-12-03  Padraig O'Briain <padraig.obriain@sun.com>
 
        * registryd/desktop.c: Add checking that we are not exiting before
index 45155e0..e4c0520 100644 (file)
@@ -49,6 +49,7 @@ static SpiApplication *this_app = NULL;
 static gboolean registry_died = FALSE;
 static gboolean atk_listeners_registered = FALSE;
 static gint toplevels = 0;
+static gboolean exiting = FALSE;
 
 static guint atk_signal_text_changed;
 static guint atk_signal_children_changed;
@@ -316,8 +317,12 @@ spi_atk_bridge_get_registry (void)
   if (registry_died || (registry == CORBA_OBJECT_NIL)) {
          CORBA_exception_init (&ev);
          if (registry_died) 
-           DBG (1, g_warning ("registry died! restarting..."));
-         
+            {
+              if (exiting)
+                return CORBA_OBJECT_NIL;
+              else
+               DBG (1, g_warning ("registry died! restarting..."));
+            }
          bonobo_activation_set_activation_env_value ("AT_SPI_DISPLAY", spi_display_name ());
 
          registry = bonobo_activation_activate_from_id (
@@ -492,6 +497,7 @@ spi_atk_bridge_exit_func (void)
       _exit (0);
     }
 
+  exiting = TRUE;
   /*
    * Check whether we still have windows which have not been deleted.
    */
@@ -508,7 +514,8 @@ spi_atk_bridge_exit_func (void)
       g_assert (bonobo_activate ());
     }
   
-  deregister_application (app);
+  if (!registry_died)
+    deregister_application (app);
 
   DBG (1, g_message ("bridge exit func complete.\n"));
 
@@ -596,6 +603,7 @@ spi_atk_emit_eventv (const GObject         *gobject,
   Accessibility_Event e;
   SpiAccessible      *source;
   AtkObject          *aobject;
+  Accessibility_Registry registry;
 #ifdef SPI_BRIDGE_DEBUG
   CORBA_string s;
 #endif
@@ -636,7 +644,11 @@ spi_atk_emit_eventv (const GObject         *gobject,
       CORBA_free (s);
 #endif
       CORBA_exception_init (&ev);
-      Accessibility_Registry_notifyEvent (spi_atk_bridge_get_registry (), 
+      registry = spi_atk_bridge_get_registry ();
+      if (registry_died)
+        return;
+        
+      Accessibility_Registry_notifyEvent (registry, 
                                          &e, &ev);
 #ifdef SPI_BRIDGE_DEBUG
       if (ev._major != CORBA_NO_EXCEPTION)
@@ -1090,6 +1102,8 @@ spi_atk_tidy_windows (void)
       if (atk_state_set_contains_state (stateset, ATK_STATE_ACTIVE))
         {
           spi_atk_emit_eventv (G_OBJECT (child), 0, 0, &any, "window:deactivate");
+          if (registry_died)
+            return;
         }
       g_object_unref (stateset);