[gnome-desktop] Fix two problems that causes g-s-d to crash at start



commit 11880c8bfd7b3f1edde58b8e83e46ebd59a44311
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 11 19:24:57 2011 -0500

    Fix two problems that causes g-s-d to crash at start
    
    We need to ref outputs when we are copying them in the parser,
    and we need to avoid confusing i and j, even if they both have
    dots.

 libgnome-desktop/gnome-rr-config.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libgnome-desktop/gnome-rr-config.c b/libgnome-desktop/gnome-rr-config.c
index 3dbfdc4..5eae693 100644
--- a/libgnome-desktop/gnome-rr-config.c
+++ b/libgnome-desktop/gnome-rr-config.c
@@ -690,7 +690,8 @@ gnome_rr_config_load_filename (GnomeRRConfig *result, const char *filename, GErr
 
 		array = g_ptr_array_new ();
 		for (j = 0; configs[i]->priv->outputs[j] != NULL; j++) {
-		    g_ptr_array_add (array, configs[i]->priv->outputs[i]);
+                    g_object_ref (configs[i]->priv->outputs[j]);
+		    g_ptr_array_add (array, configs[i]->priv->outputs[j]);
 		}
 		g_ptr_array_add (array, NULL);
 		result->priv->outputs = (GnomeRROutputInfo **) g_ptr_array_free (array, FALSE);



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