diff options
author | John (J5) Palmieri <johnp@redhat.com> | 2006-07-14 03:09:22 +0000 |
---|---|---|
committer | John (J5) Palmieri <johnp@redhat.com> | 2006-07-14 03:09:22 +0000 |
commit | 5efe8e7f1d97931710558495a951e0b35afbfb72 (patch) | |
tree | 2fbb5d61947f61616c3f9ef6e5b51b0439133b0a /dbus/dbus-pending-call.c | |
parent | 7628b541258d906e27e2000a402ed2d02383479c (diff) |
* dbus-connection.c (dbus_connection_send_with_reply): return TRUE
and set pending_reply out arg to NULL is connection is disconnected
(connection_timeout_and_complete_all_pending_calls_unlocked): New
static method for cleaning up pending calls on disconnect
(_dbus_connection_get_dispatch_status_unlocked): If we have pending
calls queued timeouts on disconnect
* dbus/dbus-pending-call.ci (_dbus_pending_call_set_connection):
Remove
Diffstat (limited to 'dbus/dbus-pending-call.c')
-rw-r--r-- | dbus/dbus-pending-call.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/dbus/dbus-pending-call.c b/dbus/dbus-pending-call.c index 66573f66..e3bfbb42 100644 --- a/dbus/dbus-pending-call.c +++ b/dbus/dbus-pending-call.c @@ -83,7 +83,7 @@ _dbus_pending_call_new (DBusConnection *connection, DBusTimeout *timeout; _dbus_assert (timeout_milliseconds >= 0 || timeout_milliseconds == -1); - + if (timeout_milliseconds == -1) timeout_milliseconds = _DBUS_DEFAULT_TIMEOUT_VALUE; @@ -119,8 +119,11 @@ _dbus_pending_call_new (DBusConnection *connection, pending->refcount.value = 1; pending->connection = connection; + dbus_connection_ref (pending->connection); + pending->timeout = timeout; + _dbus_data_slot_list_init (&pending->slot_list); return pending; @@ -285,34 +288,6 @@ _dbus_pending_call_get_connection (DBusPendingCall *pending) } /** - * Sets the connection associated with the pending call - * - * @param pending the pending_call - * @param connection the connection which is associated with the pending call - */ -void -_dbus_pending_call_set_connection (DBusPendingCall *pending, - DBusConnection *connection) -{ - _dbus_assert (pending != NULL); - - pending->connection = connection; -} - -/** - * NULLs out the connection - * - * @param pending the pending_call - */ -void -_dbus_pending_call_clear_connection (DBusPendingCall *pending) -{ - _dbus_assert (pending != NULL); - - pending->connection = NULL; -} - -/** * Sets the reply message associated with the pending call to a timeout error * * @param pending the pending_call @@ -403,12 +378,13 @@ dbus_pending_call_unref (DBusPendingCall *pending) /* If we get here, we should be already detached * from the connection, or never attached. */ - _dbus_assert (pending->connection == NULL); _dbus_assert (!pending->timeout_added); + + dbus_connection_unref (pending->connection); /* this assumes we aren't holding connection lock... */ _dbus_data_slot_list_free (&pending->slot_list); - + if (pending->timeout != NULL) _dbus_timeout_unref (pending->timeout); |