[gdm] daemon: Plug XDMCP chooser leak



commit 0af2a338de4273d6baba4157e4b69e22d97f07c5
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed Jul 20 08:22:03 2011 -0400

    daemon: Plug XDMCP chooser leak
    
    The GDM chooser will leak a file descriptor for the auth file
    each time the chooser is restarted.
    
    This commit plugs the leak in a similar way to
    
    commit 0c34aa7949bc24a2a8b3217cefb3c978b892591b
    
    but for the chooser instead of remote greeters.

 daemon/gdm-xdmcp-chooser-display.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-xdmcp-chooser-display.c b/daemon/gdm-xdmcp-chooser-display.c
index 69bf150..ba6c48b 100644
--- a/daemon/gdm-xdmcp-chooser-display.c
+++ b/daemon/gdm-xdmcp-chooser-display.c
@@ -64,6 +64,7 @@ static guint signals [LAST_SIGNAL] = { 0, };
 static void     gdm_xdmcp_chooser_display_class_init    (GdmXdmcpChooserDisplayClass *klass);
 static void     gdm_xdmcp_chooser_display_init          (GdmXdmcpChooserDisplay      *xdmcp_chooser_display);
 static void     gdm_xdmcp_chooser_display_finalize      (GObject                     *object);
+static gboolean gdm_xdmcp_chooser_display_finish (GdmDisplay *display);
 
 G_DEFINE_TYPE (GdmXdmcpChooserDisplay, gdm_xdmcp_chooser_display, GDM_TYPE_XDMCP_DISPLAY)
 
@@ -161,6 +162,7 @@ gdm_xdmcp_chooser_display_class_init (GdmXdmcpChooserDisplayClass *klass)
 
         display_class->manage = gdm_xdmcp_chooser_display_manage;
         display_class->set_slave_bus_name = gdm_xdmcp_chooser_display_set_slave_bus_name;
+        display_class->finish = gdm_xdmcp_chooser_display_finish;
 
         signals [HOSTNAME_SELECTED] =
                 g_signal_new ("hostname-selected",
@@ -205,6 +207,18 @@ gdm_xdmcp_chooser_display_finalize (GObject *object)
         G_OBJECT_CLASS (gdm_xdmcp_chooser_display_parent_class)->finalize (object);
 }
 
+static gboolean
+gdm_xdmcp_chooser_display_finish (GdmDisplay *display)
+{
+        g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
+
+        GDM_DISPLAY_CLASS (gdm_xdmcp_chooser_display_parent_class)->finish (display);
+
+        gdm_display_unmanage (display);
+
+        return TRUE;
+}
+
 GdmDisplay *
 gdm_xdmcp_chooser_display_new (const char              *hostname,
                                int                      number,



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