Previously, we were fetching the desktop, and apparently this may return
NULL if the registry is gone. I'm not sure if this should be happening,
and I have no idea if there may be other NULL pointer dereferences in
that case, but this removes one of them and simplifies the code a bit.
else if (!new[0])
registry_lost = TRUE;
}
- else
+ else if (app_hash)
{
- AtspiAccessible *desktop = atspi_get_desktop (0);
- GList *l;
- for (l = desktop->children; l; l = l->next)
- {
- AtspiAccessible *child = l->data;
- if (!strcmp (child->parent.app->bus_name, old))
- g_object_run_dispose (G_OBJECT (child->parent.app));
- }
- g_object_unref (desktop);
+ AtspiApplication *app = g_hash_table_lookup (app_hash, old);
+ if (app)
+ g_object_run_dispose (G_OBJECT (app));
}
return DBUS_HANDLER_RESULT_HANDLED;
}