diff options
author | Cosimo Alfarano <cosimo.alfarano@collabora.com> | 2013-08-23 02:12:46 +0200 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2013-08-23 02:14:28 +0200 |
commit | 7f6d7229d8812d985d544cf5dd3636865c5abc81 (patch) | |
tree | b3b5bd0f7440ce72a0befdce0109618b8ce527b5 /dbus/dbus-transport.c | |
parent | 22fc03d274f186a788efbdbe6b6dfcff1ad474df (diff) | |
download | dbus-7f6d7229d8812d985d544cf5dd3636865c5abc81.tar.gz |
Remove refcounting from DBusAuth and DBusAuthorization
Those structs are for DBusTransport internal use, they should not be
referenced outside it.
The transport needs only to allocate memory on initialization and free
it on finalization.
The lifecycle for the two allocated structs is DBusTransport lifecycle
and at DBusTransport's finalization its connection is already
disconnected.
The assumption is that the transport owns a reference for any object the
two structs holds a reference for (particularly DBusConnection)
Bug: http://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'dbus/dbus-transport.c')
-rw-r--r-- | dbus/dbus-transport.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c index 3a9cf84b..db16574a 100644 --- a/dbus/dbus-transport.c +++ b/dbus/dbus-transport.c @@ -134,7 +134,7 @@ _dbus_transport_init_base (DBusTransport *transport, if (auth == NULL) { if (authorization != NULL) - _dbus_authorization_unref (authorization); + _dbus_authorization_free (authorization); _dbus_message_loader_unref (loader); return FALSE; } @@ -142,9 +142,9 @@ _dbus_transport_init_base (DBusTransport *transport, counter = _dbus_counter_new (); if (counter == NULL) { - _dbus_auth_unref (auth); + _dbus_auth_free (auth); if (authorization != NULL) - _dbus_authorization_unref (authorization); + _dbus_authorization_free (authorization); _dbus_message_loader_unref (loader); return FALSE; } @@ -153,9 +153,9 @@ _dbus_transport_init_base (DBusTransport *transport, if (creds == NULL) { _dbus_counter_unref (counter); - _dbus_auth_unref (auth); + _dbus_auth_free (auth); if (authorization != NULL) - _dbus_authorization_unref (authorization); + _dbus_authorization_free (authorization); _dbus_message_loader_unref (loader); return FALSE; } @@ -173,9 +173,9 @@ _dbus_transport_init_base (DBusTransport *transport, { _dbus_credentials_unref (creds); _dbus_counter_unref (counter); - _dbus_auth_unref (auth); + _dbus_auth_free (auth); if (authorization != NULL) - _dbus_authorization_unref (authorization); + _dbus_authorization_free (authorization); _dbus_message_loader_unref (loader); return FALSE; } @@ -237,9 +237,9 @@ _dbus_transport_finalize_base (DBusTransport *transport) _dbus_transport_disconnect (transport); _dbus_message_loader_unref (transport->loader); - _dbus_auth_unref (transport->auth); + _dbus_auth_free (transport->auth); if (transport->authorization) - _dbus_authorization_unref (transport->authorization); + _dbus_authorization_free (transport->authorization); _dbus_counter_set_notify (transport->live_messages, 0, 0, NULL, NULL); _dbus_counter_unref (transport->live_messages); |