diff -ur dbus-1.2.12/dbus/dbus-connection.c dbus-1.2.12-patched/dbus/dbus-connection.c --- dbus-1.2.12/dbus/dbus-connection.c 2008-08-07 20:44:36.000000000 +0200 +++ dbus-1.2.12-patched/dbus/dbus-connection.c 2009-02-10 23:23:32.000000000 +0100 @@ -2269,13 +2269,16 @@ _dbus_assert (pending != NULL); - if (dbus_pending_call_get_completed (pending)) + connection = _dbus_pending_call_get_connection_and_lock (pending); + + if (_dbus_pending_call_get_completed_unlocked (pending)) + { + CONNECTION_UNLOCK (connection); return; + } dbus_pending_call_ref (pending); /* necessary because the call could be canceled */ - connection = _dbus_pending_call_get_connection_and_lock (pending); - /* Flush message queue - note, can affect dispatch status */ _dbus_connection_flush_unlocked (connection);