[gnome-control-center/gnome-3-14] region: Fix leak in input chooser



commit 220d4e332209f217f296ecebc77673b938fa6546
Author: Joaquim Rocha <me joaquimrocha com>
Date:   Tue Feb 24 20:45:39 2015 +0100

    region: Fix leak in input chooser
    
    The language input chooser is being leaked. The reason for the leak
    is a "circular reference": the input chooser keeps a GtkBuilder
    instance that gets destroyed when the chooser is, itself, destroyed.
    However, the input chooser is never destroyed because the GtkBuilder
    instance keeps a reference to it.
    
    These changes dismiss the GtkBuilder once it is no longer needed in the
    input chooser which fixes the leak.

 panels/region/cc-input-chooser.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/panels/region/cc-input-chooser.c b/panels/region/cc-input-chooser.c
index 26a30a2..857c77c 100644
--- a/panels/region/cc-input-chooser.c
+++ b/panels/region/cc-input-chooser.c
@@ -1137,7 +1137,6 @@ cc_input_chooser_new (GtkWindow    *main_window,
   chooser = WID ("input-dialog");
   priv = g_new0 (CcInputChooserPrivate, 1);
   g_object_set_data_full (G_OBJECT (chooser), "private", priv, cc_input_chooser_private_free);
-  g_object_set_data_full (G_OBJECT (chooser), "builder", builder, g_object_unref);
 
   priv->xkb_info = xkb_info;
   priv->ibus_engines = ibus_engines;
@@ -1173,6 +1172,8 @@ cc_input_chooser_new (GtkWindow    *main_window,
 
   gtk_window_set_transient_for (GTK_WINDOW (chooser), main_window);
 
+  g_object_unref (builder);
+
   return chooser;
 }
 


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