[gdm/multi-stack: 43/50] Fix memory handling of task in task list



commit bb943f545d444f2b3c7fef0fb05390f150a20e5e
Author: Ray Strode <rstrode redhat com>
Date:   Wed Oct 28 22:04:44 2009 -0400

    Fix memory handling of task in task list

 gui/simple-greeter/gdm-task-list.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-task-list.c b/gui/simple-greeter/gdm-task-list.c
index 162b784..be50832 100644
--- a/gui/simple-greeter/gdm-task-list.c
+++ b/gui/simple-greeter/gdm-task-list.c
@@ -203,7 +203,8 @@ gdm_task_list_add_task (GdmTaskList *task_list,
         gtk_widget_show (button);
 
         gtk_container_add (GTK_CONTAINER (task_list->priv->box), button);
-        task_list->priv->tasks = g_list_append (task_list->priv->tasks, task);
+        task_list->priv->tasks = g_list_append (task_list->priv->tasks,
+                                                g_object_ref (task));
 
         if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
                 g_signal_emit (task_list, signals[ACTIVATED], 0, task);
@@ -261,7 +262,7 @@ gdm_task_list_finalize (GObject *object)
 
         widget = GDM_TASK_LIST (object);
 
-        g_list_foreach (widget->priv->tasks, (GFunc) g_free, NULL);
+        g_list_foreach (widget->priv->tasks, (GFunc) g_object_unref, NULL);
         g_list_free (widget->priv->tasks);
 
         G_OBJECT_CLASS (gdm_task_list_parent_class)->finalize (object);



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