[gdm/gnome-2-30] Fix usage of user manager



commit e6e949bc1dca27cbd92fa6741d13bf702a02133f
Author: William Jon McCann <jmccann redhat com>
Date:   Wed Jun 23 12:52:01 2010 -0400

    Fix usage of user manager
    
    Don't use it if it doesn't exit and unref it when done.

 gui/simple-greeter/gdm-user-chooser-widget.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-user-chooser-widget.c b/gui/simple-greeter/gdm-user-chooser-widget.c
index 795ca3d..ecb5601 100644
--- a/gui/simple-greeter/gdm-user-chooser-widget.c
+++ b/gui/simple-greeter/gdm-user-chooser-widget.c
@@ -225,6 +225,10 @@ on_item_load (GdmChooserWidget     *widget,
 
         g_debug ("GdmUserChooserWidget: Loading item for id=%s", id);
 
+        if (user_chooser->priv->manager == NULL) {
+                return;
+        }
+
         user = gdm_user_manager_get_user (user_chooser->priv->manager, id);
         if (user != NULL) {
                 update_item_for_user (user_chooser, user);
@@ -759,6 +763,11 @@ gdm_user_chooser_widget_dispose (GObject *object)
                 g_object_unref (widget->priv->stock_person_pixbuf);
                 widget->priv->stock_person_pixbuf = NULL;
         }
+
+        if (widget->priv->manager != NULL) {
+                g_object_unref (widget->priv->manager);
+                widget->priv->manager = NULL;
+        }
 }
 
 static void



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