diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-11-28 17:11:38 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-11-01 11:48:40 +0000 |
commit | 7c540d743db0d7b2f00d35782defcacda8b1479c (patch) | |
tree | 7a77883a80b50f60c9b06cbe6983b95744d45fe4 | |
parent | c3f20a67e623f7277a9ca5610fa8416d6ed5c04d (diff) | |
download | dbus-7c540d743db0d7b2f00d35782defcacda8b1479c.tar.gz |
transaction_free: factor out
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60859
Reviewed-by: Chengwei Yang
[removed unused variable based on review -smcv]
-rw-r--r-- | bus/connection.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/bus/connection.c b/bus/connection.c index d69758c9..fddbc78a 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -2126,6 +2126,16 @@ bus_transaction_send (BusTransaction *transaction, } static void +transaction_free (BusTransaction *transaction) +{ + _dbus_assert (transaction->connections == NULL); + + free_cancel_hooks (transaction); + + dbus_free (transaction); +} + +static void connection_cancel_transaction (DBusConnection *connection, BusTransaction *transaction) { @@ -2163,14 +2173,10 @@ bus_transaction_cancel_and_free (BusTransaction *transaction) while ((connection = _dbus_list_pop_first (&transaction->connections))) connection_cancel_transaction (connection, transaction); - _dbus_assert (transaction->connections == NULL); - _dbus_list_foreach (&transaction->cancel_hooks, cancel_hook_cancel, NULL); - free_cancel_hooks (transaction); - - dbus_free (transaction); + transaction_free (transaction); } static void @@ -2224,11 +2230,7 @@ bus_transaction_execute_and_free (BusTransaction *transaction) while ((connection = _dbus_list_pop_first (&transaction->connections))) connection_execute_transaction (connection, transaction); - _dbus_assert (transaction->connections == NULL); - - free_cancel_hooks (transaction); - - dbus_free (transaction); + transaction_free (transaction); } static void |