[gnome-control-center/wip/region-panel: 23/43] Fix some memory leaks
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/region-panel: 23/43] Fix some memory leaks
- Date: Sun, 17 Feb 2013 00:31:54 +0000 (UTC)
commit 3b86c82fee1bd8fda64cee135fdd39ae85b203a4
Author: Rui Matos <tiagomatos gmail com>
Date: Mon Feb 4 17:15:58 2013 +0100
Fix some memory leaks
panels/common/cc-language-chooser.c | 4 ++++
panels/region/cc-format-chooser.c | 2 ++
panels/region/cc-input-options.c | 2 ++
3 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/panels/common/cc-language-chooser.c b/panels/common/cc-language-chooser.c
index a1ac6e7..0819b51 100644
--- a/panels/common/cc-language-chooser.c
+++ b/panels/common/cc-language-chooser.c
@@ -225,6 +225,8 @@ add_all_languages (GtkDialog *chooser)
locale_ids = gnome_get_all_locales ();
initial = cc_common_language_get_initial_languages ();
add_languages (chooser, locale_ids, initial);
+ g_hash_table_destroy (initial);
+ g_strfreev (locale_ids);
}
static gboolean
@@ -360,6 +362,7 @@ cc_language_chooser_new (GtkWidget *parent)
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/org/gnome/control-center/common/language-chooser.ui",
&error);
if (error) {
+ g_object_unref (builder);
g_warning ("failed to load language chooser: %s", error->message);
g_error_free (error);
return NULL;
@@ -368,6 +371,7 @@ cc_language_chooser_new (GtkWidget *parent)
chooser = WID ("language-dialog");
priv = g_new0 (CcLanguageChooserPrivate, 1);
g_object_set_data_full (G_OBJECT (chooser), "private", priv, cc_language_chooser_private_free);
+ g_object_set_data_full (G_OBJECT (chooser), "builder", builder, g_object_unref);
priv->filter_entry = WID ("language-filter-entry");
priv->language_list = WID ("language-list");
diff --git a/panels/region/cc-format-chooser.c b/panels/region/cc-format-chooser.c
index 43d04f8..d213a16 100644
--- a/panels/region/cc-format-chooser.c
+++ b/panels/region/cc-format-chooser.c
@@ -444,6 +444,7 @@ cc_format_chooser_new (GtkWidget *parent)
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/org/gnome/control-center/region/format-chooser.ui",
&error);
if (error) {
+ g_object_unref (builder);
g_warning ("failed to load format chooser: %s", error->message);
g_error_free (error);
return NULL;
@@ -452,6 +453,7 @@ cc_format_chooser_new (GtkWidget *parent)
chooser = WID ("dialog");
priv = g_new0 (CcFormatChooserPrivate, 1);
g_object_set_data_full (G_OBJECT (chooser), "private", priv, cc_format_chooser_private_free);
+ g_object_set_data_full (G_OBJECT (chooser), "builder", builder, g_object_unref);
priv->filter_entry = WID ("region-filter-entry");
priv->list = WID ("region-list");
diff --git a/panels/region/cc-input-options.c b/panels/region/cc-input-options.c
index 51c54eb..0112e51 100644
--- a/panels/region/cc-input-options.c
+++ b/panels/region/cc-input-options.c
@@ -165,6 +165,7 @@ cc_input_options_new (GtkWidget *parent)
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/org/gnome/control-center/region/input-options.ui", &error);
if (error) {
+ g_object_unref (builder);
g_warning ("failed to load input options: %s", error->message);
g_error_free (error);
return NULL;
@@ -173,6 +174,7 @@ cc_input_options_new (GtkWidget *parent)
options = WID ("dialog");
priv = g_new0 (CcInputOptionsPrivate, 1);
g_object_set_data_full (G_OBJECT (options), "private", priv, cc_input_options_private_free);
+ g_object_set_data_full (G_OBJECT (options), "builder", builder, g_object_unref);
priv->same_source = WID ("same-source");
priv->per_window_source = WID ("per-window-source");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]