Correctly handle at-spi2-registryd dying when processing NameOwnerChanged
authorMike Gorse <mgorse@suse.com>
Thu, 2 Jun 2016 23:53:26 +0000 (18:53 -0500)
committerMike Gorse <mgorse@suse.com>
Thu, 2 Jun 2016 23:53:26 +0000 (18:53 -0500)
If at-spi2-registryd dies, then we receive two NameOwnerChanged signals,
one for org.a11y.atspi.Registry and the other for the initial dbus-issued
name. When we received the latter, we were matching it to the AtspiApplication
corresponding to the desktop and inadvertently disposing it, leading to a
crash later on.

atspi/atspi-misc.c

index 1ec9be1..1dcc3de 100644 (file)
@@ -389,7 +389,7 @@ handle_name_owner_changed (DBusConnection *bus, DBusMessage *message, void *user
   else if (app_hash)
   {
     AtspiApplication *app = g_hash_table_lookup (app_hash, old);
-    if (app)
+    if (app && !strcmp (app->bus_name, old))
       g_object_run_dispose (G_OBJECT (app));
   }
   return DBUS_HANDLER_RESULT_HANDLED;