g_assert (g_list_find_custom (types, plain, find_mime) != NULL);
g_assert (g_list_find_custom (types, xml, find_mime) != NULL);
- g_list_foreach (types, (GFunc)g_free, NULL);
- g_list_free (types);
+ g_list_free_full (types, g_free);
g_free (plain);
g_free (xml);
info = (GAppInfo *)list->next->data;
g_assert (g_strcmp0 (g_app_info_get_id (info), g_app_info_get_id (info1)) == 0);
- g_list_foreach (list, (GFunc)g_object_unref, NULL);
- g_list_free (list);
+ g_list_free_full (list, g_object_unref);
/* now try adding something at the end */
g_app_info_add_supports_type (info3, "application/x-test", &error);
info = (GAppInfo *)list->next->next->data;
g_assert (g_strcmp0 (g_app_info_get_id (info), g_app_info_get_id (info3)) == 0);
- g_list_foreach (list, (GFunc)g_object_unref, NULL);
- g_list_free (list);
+ g_list_free_full (list, g_object_unref);
/* now remove info1 again */
g_app_info_remove_supports_type (info1, "application/x-test", &error);
info = (GAppInfo *)list->next->data;
g_assert (g_strcmp0 (g_app_info_get_id (info), g_app_info_get_id (info3)) == 0);
- g_list_foreach (list, (GFunc)g_object_unref, NULL);
- g_list_free (list);
+ g_list_free_full (list, g_object_unref);
/* now clean it all up */
g_app_info_reset_type_associations ("application/x-test");
* can be used to get the value of the :Mood property.
*/
}
- g_list_foreach (interfaces, (GFunc) g_object_unref, NULL);
- g_list_free (interfaces);
+ g_list_free_full (interfaces, g_object_unref);
}
- g_list_foreach (objects, (GFunc) g_object_unref, NULL);
- g_list_free (objects);
+ g_list_free_full (objects, g_object_unref);
}
static void
g_main_loop_unref (data->loop);
g_main_context_unref (data->context);
g_object_unref (data->server);
- g_list_foreach (data->connections, (GFunc) g_object_unref, NULL);
- g_list_free (data->connections);
+ g_list_free_full (data->connections, g_object_unref);
g_free (data);
}
*/
object_proxies = g_dbus_object_manager_get_objects (pm);
g_assert (g_list_length (object_proxies) == 2);
- g_list_foreach (object_proxies, (GFunc) g_object_unref, NULL);
- g_list_free (object_proxies);
+ g_list_free_full (object_proxies, g_object_unref);
op = g_dbus_object_manager_get_object (pm, "/managed/first");
g_assert (op != NULL);
g_assert (FOO_IGEN_IS_OBJECT_PROXY (op));
g_assert_cmpstr (g_dbus_object_get_object_path (op), ==, "/managed/first");
proxies = g_dbus_object_get_interfaces (op);
g_assert (g_list_length (proxies) == 1);
- g_list_foreach (proxies, (GFunc) g_object_unref, NULL);
- g_list_free (proxies);
+ g_list_free_full (proxies, g_object_unref);
p = G_DBUS_PROXY (foo_igen_object_get_com_acme_coyote (FOO_IGEN_OBJECT (op)));
g_assert (p != NULL);
g_assert_cmpint (G_TYPE_FROM_INSTANCE (p), ==, FOO_IGEN_TYPE_COM_ACME_COYOTE_PROXY);
g_assert_cmpstr (g_dbus_object_get_object_path (op), ==, "/managed/second");
proxies = g_dbus_object_get_interfaces (op);
g_assert (g_list_length (proxies) == 2);
- g_list_foreach (proxies, (GFunc) g_object_unref, NULL);
- g_list_free (proxies);
+ g_list_free_full (proxies, g_object_unref);
p = G_DBUS_PROXY (foo_igen_object_get_bat (FOO_IGEN_OBJECT (op)));
g_assert (p != NULL);
g_assert_cmpint (G_TYPE_FROM_INSTANCE (p), ==, FOO_IGEN_TYPE_BAT_PROXY);
do_volume_tests (drive, volume);
}
- g_list_foreach (volumes, (GFunc)g_object_unref, NULL);
- g_list_free (volumes);
+ g_list_free_full (volumes, g_object_unref);
}
static void
do_drive_tests (drive);
}
- g_list_foreach (drives, (GFunc)g_object_unref, NULL);
- g_list_free (drives);
+ g_list_free_full (drives, g_object_unref);
}
static void
g_object_unref (drive);
}
- g_list_foreach (volumes, (GFunc)g_object_unref, NULL);
- g_list_free (volumes);
+ g_list_free_full (volumes, g_object_unref);
}
static void
g_object_unref (volume);
}
- g_list_foreach (mounts, (GFunc)g_object_unref, NULL);
- g_list_free (mounts);
+ g_list_free_full (mounts, g_object_unref);
}
int
main (int argc, char *argv[])