[PATCH] dbus-connection.c: Remove the timer for the pending call's timeout in case the reply has timed out in blocking code.
Thiago Macieira
thiago at kde.org
Fri May 16 06:15:24 PDT 2008
This fixes bug 15684, which prevents crashes in some applications due
to timers firing after the DBusPendingCall object has been freed.
---
dbus/dbus-connection.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index 3a1670c..7b13b24 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -965,6 +965,13 @@ _dbus_connection_detach_pending_call_and_unlock
(DBusConnection *connection,
_dbus_pending_call_ref_unlocked (pending);
_dbus_hash_table_remove_int (connection->pending_replies,
_dbus_pending_call_get_reply_serial_unlocked
(pending));
+
+ if (_dbus_pending_call_is_timeout_added_unlocked (pending))
+ _dbus_connection_remove_timeout_unlocked (connection,
+ _dbus_pending_call_get_timeout_unlocked (pending));
+
+ _dbus_pending_call_set_timeout_added_unlocked (pending, FALSE);
+
_dbus_pending_call_unref_and_unlock (pending);
}
--
1.5.5.rc1.12.g660b9
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dbus-connection.c-Remove-the-timer-for-the-pending.patch
Type: text/x-diff
Size: 1302 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20080516/d24b8f93/attachment.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20080516/d24b8f93/attachment.pgp
More information about the dbus
mailing list