gdbusobjectskeleton: Get the ifaces via array instead of list

This commit is contained in:
Marco Trevisan (Treviño) 2022-12-14 05:12:28 +01:00
parent 036dabcff9
commit 52900ed6b0

View File

@ -473,17 +473,21 @@ g_dbus_object_skeleton_get_interfaces (GDBusObject *_object)
void
g_dbus_object_skeleton_flush (GDBusObjectSkeleton *object)
{
GList *to_flush, *l;
GPtrArray *to_flush;
g_mutex_lock (&object->priv->lock);
to_flush = g_hash_table_get_values (object->priv->map_name_to_iface);
g_list_foreach (to_flush, (GFunc) g_object_ref, NULL);
to_flush = g_hash_table_get_values_as_ptr_array (object->priv->map_name_to_iface);
g_ptr_array_foreach (to_flush, (GFunc) g_object_ref, NULL);
g_ptr_array_set_free_func (to_flush, g_object_unref);
g_mutex_unlock (&object->priv->lock);
for (l = to_flush; l != NULL; l = l->next)
g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (l->data));
for (guint i = 0; i < to_flush->len; ++i)
{
g_dbus_interface_skeleton_flush (
G_DBUS_INTERFACE_SKELETON (g_ptr_array_index (to_flush, i)));
}
g_list_free_full (to_flush, g_object_unref);
g_clear_pointer (&to_flush, g_ptr_array_unref);
}
static void