[gnome-control-center/gnome-3-14] display: Don't leak GnomeRRModes



commit a963a9c3f4c605b9465392774900171c7eb5721b
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Mar 25 18:58:14 2015 +0100

    display: Don't leak GnomeRRModes
    
    GnomeRRMode is a boxed type which means that if stored as such in a
    tree model, the model creates a copy to use internally. In addition,
    it means that gtk_tree_model_get() will also get a copy which must be
    freed by the caller which we were not doing.
    
    In this case though, we don't need the copies since all the
    GnomeRRModes that we use outlive the model so we can simplify things
    by just storing a plain pointer in the model instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655041

 panels/display/cc-display-panel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 366f20e..98e89cd 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -2113,7 +2113,7 @@ show_setup_dialog (CcDisplayPanel *panel)
   gtk_widget_set_halign (label, GTK_ALIGN_START);
 
   /* resolution combo box */
-  res_model = gtk_list_store_new (2, G_TYPE_STRING, GNOME_TYPE_RR_MODE);
+  res_model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
   priv->res_combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (res_model));
   g_object_unref (res_model);
   renderer = gtk_cell_renderer_text_new ();


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