[gdm] Change user manager user weak ref to strong ref



commit c690a9b51dca5700bb5e512e6f2e55d9440a145a
Author: Ray Strode <rstrode redhat com>
Date:   Mon Sep 13 10:15:34 2010 -0400

    Change user manager user weak ref to strong ref
    
    The on_users_loaded function assumes it owns a
    strong reference to the user.

 gui/simple-greeter/gdm-user-manager.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-user-manager.c b/gui/simple-greeter/gdm-user-manager.c
index bd36380..305fd93 100644
--- a/gui/simple-greeter/gdm-user-manager.c
+++ b/gui/simple-greeter/gdm-user-manager.c
@@ -688,12 +688,6 @@ set_has_multiple_users (GdmUserManager *manager,
                 g_object_notify (G_OBJECT (manager), "has-multiple-users");
         }
 }
-static void
-on_new_user_destroyed (GdmUserManager *manager,
-                       GdmUser        *user)
-{
-        manager->priv->new_users = g_slist_remove (manager->priv->new_users, user);
-}
 
 static GdmUser *
 create_new_user (GdmUserManager *manager)
@@ -703,11 +697,10 @@ create_new_user (GdmUserManager *manager)
         user = g_object_new (GDM_TYPE_USER, NULL);
 
         manager->priv->new_users = g_slist_prepend (manager->priv->new_users, user);
-        g_object_weak_ref (G_OBJECT (user), (GWeakNotify) on_new_user_destroyed, manager);
 
         g_signal_connect (user, "notify::is-loaded", G_CALLBACK (on_new_user_loaded), manager);
 
-        return user;
+        return g_object_ref (user);
 }
 
 static void
@@ -784,7 +777,6 @@ on_new_user_loaded (GdmUser        *user,
         g_signal_handlers_disconnect_by_func (user, on_new_user_loaded, manager);
         manager->priv->new_users = g_slist_remove (manager->priv->new_users,
                                                    user);
-        g_object_weak_unref (G_OBJECT (user), (GWeakNotify) on_new_user_destroyed, manager);
 
         username = gdm_user_get_user_name (user);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]