if (f->right_conn != NULL)
{
+ GList *link;
+
if (f->right_conn_echo)
{
dbus_connection_remove_filter (f->right_conn, echo_filter, f);
f->right_conn_hold = FALSE;
}
- g_queue_foreach (&f->held_messages, (GFunc) dbus_message_unref, NULL);
+ for (link = f->held_messages.head; link != NULL; link = link->next)
+ dbus_message_unref (link->data);
+
g_queue_clear (&f->held_messages);
dbus_connection_close (f->right_conn);
if (f->right_conn != NULL)
{
+ GList *link;
+
if (added_hold_filter)
dbus_connection_remove_filter (f->right_conn, hold_filter, f);
- g_queue_foreach (&f->held_messages, (GFunc) dbus_message_unref, NULL);
+ for (link = f->held_messages.head; link != NULL; link = link->next)
+ dbus_message_unref (link->data);
+
g_queue_clear (&f->held_messages);
dbus_connection_close (f->right_conn);
teardown (Fixture *f,
gconstpointer context G_GNUC_UNUSED)
{
+ GList *link;
+
dbus_error_free (&f->e);
g_clear_error (&f->ge);
test_main_context_unref (f->ctx);
- g_queue_foreach (&f->monitored, (GFunc) dbus_message_unref, NULL);
+ for (link = f->monitored.head; link != NULL; link = link->next)
+ dbus_message_unref (link->data);
+
g_queue_clear (&f->monitored);
- g_queue_foreach (&f->received, (GFunc) dbus_message_unref, NULL);
+ for (link = f->received.head; link != NULL; link = link->next)
+ dbus_message_unref (link->data);
+
g_queue_clear (&f->received);
g_free (f->address);