[gnome-control-center] display: Don't leak GnomeRRModes
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] display: Don't leak GnomeRRModes
- Date: Mon, 13 Apr 2015 12:10:39 +0000 (UTC)
commit 0d6369a76206a4beb64df8fb2ef829f432415482
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 d2eb79e..5bf9279 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 ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]