return;
child = g_value_get_object (&event->any_data);
+ if (child)
+ return;
if (!strncmp (event->type, "object:children-changed:add", 27))
{
- if (g_list_find (event->source->children, child))
+ g_ptr_array_remove (event->source->children, child); /* just to be safe */
+ if (event->detail1 < 0 || event->detail1 > event->source->children->len)
+ {
+ event->source->cached_properties &= ~ATSPI_CACHE_CHILDREN;
return;
- event->source->children = g_list_insert (event->source->children,
- g_object_ref (child),
- event->detail1);
+ }
+ /* Unfortunately, there's no g_ptr_array_insert or similar */
+ g_ptr_array_add (event->source->children, NULL);
+ memmove (event->source->children->pdata + event->detail1 + 1,
+ event->source->children->pdata + event->detail1,
+ (event->source->children->len - event->detail1 - 1) * sizeof (gpointer));
+ g_ptr_array_index (event->source->children, event->detail1) = g_object_ref (child);
}
- else if (g_list_find (event->source->children, child))
+ else
{
- event->source->children = g_list_remove (event->source->children, child);
+ g_ptr_array_remove (event->source->children, child);
if (child == child->parent.app->root)
g_object_run_dispose (G_OBJECT (child->parent.app));
- g_object_unref (child);
}
}
}
e.type = converted_type;
e.source = _atspi_ref_accessible (dbus_message_get_sender(message), dbus_message_get_path(message));
+ if (e.source == NULL)
+ {
+ g_warning ("Got no valid source accessible for signal for signal %s from interface %s\n", member, category);
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
dbus_message_iter_recurse (&iter, &iter_variant);
switch (dbus_message_iter_get_arg_type (&iter_variant))
if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY)
{
/* new form -- parse properties sent with event */
- _atspi_dbus_update_cache_from_dict (e.source, &iter);
+ cache = _atspi_dbus_update_cache_from_dict (e.source, &iter);
}
if (!strncmp (e.type, "object:children-changed", 23))