region: Fix a couple of memory leaks

Unref the GSettings object and build the GnomeXkbInfo only
once. There's no need to free and keep rebuilding the latter since it
doesn't keep any state and is a bit expensive to build.

https://bugzilla.gnome.org/show_bug.cgi?id=662489
This commit is contained in:
Rui Matos 2012-07-02 04:05:09 +02:00 committed by Bastien Nocera
parent 03f08fd36c
commit 49f7d379bc

View file

@ -870,7 +870,10 @@ setup_input_tabs (GtkBuilder *builder,
GtkTreeSelection *selection;
input_sources_settings = g_settings_new (GNOME_DESKTOP_INPUT_SOURCES_DIR);
xkb_info = gnome_xkb_info_new ();
g_object_weak_ref (G_OBJECT (builder), (GWeakNotify) g_object_unref, input_sources_settings);
if (!xkb_info)
xkb_info = gnome_xkb_info_new ();
#ifdef HAVE_IBUS
ibus_init ();