if (!dbus_connection_send (connection, reply, NULL))
g_error ("OOM");
- dbus_message_unref (reply);
+ dbus_clear_message (&reply);
return DBUS_HANDLER_RESULT_HANDLED;
}
NULL))
g_error ("OOM");
- dbus_pending_call_unref (pc);
- dbus_message_unref (m);
+ dbus_clear_pending_call (&pc);
+ dbus_clear_message (&m);
}
while (received < count)
&reply, NULL))
g_error ("OOM");
- dbus_pending_call_unref (pc);
- dbus_message_unref (m);
+ dbus_clear_pending_call (&pc);
+ dbus_clear_message (&m);
if (mode == DISCONNECT)
{
dbus_connection_remove_filter (f->right_conn, echo_filter, f);
dbus_connection_close (f->right_conn);
- dbus_connection_unref (f->right_conn);
- f->right_conn = NULL;
+ dbus_clear_connection (&f->right_conn);
}
while (reply == NULL)
g_assert_cmpstr (f->e.message, ==,
"Message did not receive a reply (timeout by message bus)");
- dbus_message_unref (reply);
+ dbus_clear_message (&reply);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert (seen & SEEN_WINDOWS_SID);
#endif
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_error ("Unexpected error: %s: %s", error.name, error.message);
}
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_cmpint (dbus_message_get_type (m), ==,
DBUS_MESSAGE_TYPE_METHOD_RETURN);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
- pc = NULL;
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
/* Now try with the wrong object path */
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
DBUS_ERROR_ACCESS_DENIED);
g_assert_cmpstr (dbus_message_get_signature (m), ==, "s");
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
g_assert_cmpstr (error.name, ==, DBUS_ERROR_LIMITS_EXCEEDED);
if (failing_conn != NULL)
- {
- dbus_connection_close (failing_conn);
- dbus_connection_unref (failing_conn);
- }
+ dbus_connection_close (failing_conn);
+ dbus_clear_connection (&failing_conn);
dbus_connection_close (third_conn);
- dbus_connection_unref (third_conn);
+ dbus_clear_connection (&third_conn);
}
static void
if (!dbus_connection_send (f->right_conn, reply, NULL))
g_error ("OOM");
- dbus_message_unref (reply);
- dbus_message_unref (m);
+ dbus_clear_message (&m);
+ dbus_clear_message (&reply);
}
/* Wait for all 5 replies to come in. */
if (dbus_set_error_from_message (&error, m))
g_error ("Unexpected error: %s: %s", error.name, error.message);
- dbus_message_unref (m);
+ dbus_clear_message (&m);
}
/* The last two failed. */
g_assert_cmpstr (error.name, ==, DBUS_ERROR_LIMITS_EXCEEDED);
dbus_error_free (&error);
- dbus_message_unref (m);
+ dbus_clear_message (&m);
}
g_assert_cmpuint (g_queue_get_length (&received), ==, 0);
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_nonnull (what_daemon_thinks);
g_assert_cmpuint (strlen (what_daemon_thinks), ==, 32);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
dbus_free (what_i_think);
}
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
if (!dbus_message_get_args (m, &error, DBUS_TYPE_INVALID))
g_error ("%s: %s", error.name, error.message);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_cmpstr (error.name, ==, DBUS_ERROR_UNKNOWN_INTERFACE);
dbus_error_free (&error);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_cmpstr (error.name, ==, DBUS_ERROR_UNKNOWN_INTERFACE);
dbus_error_free (&error);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_cmpstr (error.name, ==, DBUS_ERROR_UNKNOWN_PROPERTY);
dbus_error_free (&error);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_cmpstr (error.name, ==, DBUS_ERROR_UNKNOWN_INTERFACE);
dbus_error_free (&error);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_cmpstr (error.name, ==, DBUS_ERROR_UNKNOWN_INTERFACE);
dbus_error_free (&error);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_cmpstr (error.name, ==, DBUS_ERROR_UNKNOWN_INTERFACE);
dbus_error_free (&error);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_cmpstr (error.name, ==, DBUS_ERROR_UNKNOWN_INTERFACE);
dbus_error_free (&error);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_cmpstr (error.name, ==, DBUS_ERROR_UNKNOWN_PROPERTY);
dbus_error_free (&error);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
g_assert_cmpstr (error.name, ==, DBUS_ERROR_PROPERTY_READ_ONLY);
dbus_error_free (&error);
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
if (dbus_message_iter_next (&args_iter))
g_error ("Reply has too many arguments");
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
if (dbus_message_iter_next (&args_iter))
g_error ("Reply has too many arguments");
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
pc == NULL)
g_error ("OOM");
- dbus_message_unref (m);
- m = NULL;
+ dbus_clear_message (&m);
if (dbus_pending_call_get_completed (pc))
test_pending_call_store_reply (pc, &m);
if (dbus_message_iter_next (&args_iter))
g_error ("Reply has too many arguments");
- dbus_message_unref (m);
- dbus_pending_call_unref (pc);
+ dbus_clear_message (&m);
+ dbus_clear_pending_call (&pc);
}
static void
g_clear_error (&f->ge);
if (f->left_conn != NULL)
- {
- dbus_connection_close (f->left_conn);
- dbus_connection_unref (f->left_conn);
- f->left_conn = NULL;
- }
+ dbus_connection_close (f->left_conn);
if (f->right_conn != NULL)
{
g_queue_clear (&f->held_messages);
dbus_connection_close (f->right_conn);
- dbus_connection_unref (f->right_conn);
- f->right_conn = NULL;
}
+ dbus_clear_connection (&f->left_conn);
+ dbus_clear_connection (&f->right_conn);
+
if (f->daemon_pid != 0)
{
test_kill_pid (f->daemon_pid);