summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2015-03-25 18:58:14 +0100
committerRui Matos <tiagomatos@gmail.com>2015-04-13 14:05:49 +0200
commit0d6369a76206a4beb64df8fb2ef829f432415482 (patch)
tree8e5cfadc94739aa433cf7435bf4338026faf5b17
parent5e0b26dac5a63e7feaa31117d12bc91d76bce2bd (diff)
downloadgnome-control-center-0d6369a76206a4beb64df8fb2ef829f432415482.tar.gz
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
-rw-r--r--panels/display/cc-display-panel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index d2eb79e32..5bf927950 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -2153,7 +2153,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 ();