aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-07-01 13:12:08 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-07-01 13:12:08 -0500
commiteb7e99b24b15a311f188754bf3d0d4f72551deab (patch)
tree4ffeb5cc7c825d2e9b44d31738280b95ec6ff4b1
parentd5421fec0a7e51ddb1979a97de271a3f1733321e (diff)
downloadayatana-indicator-session-eb7e99b24b15a311f188754bf3d0d4f72551deab.tar.gz
ayatana-indicator-session-eb7e99b24b15a311f188754bf3d0d4f72551deab.tar.bz2
ayatana-indicator-session-eb7e99b24b15a311f188754bf3d0d4f72551deab.zip
in src/backend-dbus/users.c's track_user(), simplify the ref/unref semantics of the user argument
-rw-r--r--src/backend-dbus/users.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend-dbus/users.c b/src/backend-dbus/users.c
index b9a79e5..738eda4 100644
--- a/src/backend-dbus/users.c
+++ b/src/backend-dbus/users.c
@@ -215,7 +215,9 @@ track_user (IndicatorSessionUsersDbus * self,
id = g_signal_connect (user, "changed", G_CALLBACK(on_user_changed), self);
object_add_connection (G_OBJECT(user), id);
- g_hash_table_insert (p->uid_to_account, GUINT_TO_POINTER (uid), user);
+ g_hash_table_insert (p->uid_to_account,
+ GUINT_TO_POINTER (uid),
+ g_object_ref (user));
if (already_had_user)
emit_user_changed (self, uid);
@@ -266,12 +268,11 @@ on_user_proxy_ready (GObject * o G_GNUC_UNUSED,
g_error_free (err);
}
- else if (!accounts_user_get_system_account (user))
- {
- track_user (self, user);
- }
else
{
+ if (!accounts_user_get_system_account (user))
+ track_user (self, user);
+
g_object_unref (user);
}
}