summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey V. Udaltsov <svu@src.gnome.org>2004-09-27 22:33:49 +0000
committerSergey V. Udaltsov <svu@src.gnome.org>2004-09-27 22:33:49 +0000
commitb98fd2ff69cf400d74e8343e0f5b8b428b1d07c6 (patch)
tree7b60222621b068e6341baa84c24bc10a0f06293f
parentbf88391b66b450bb8728109f6c6bc2026f587e16 (diff)
downloadgnome-control-center-b98fd2ff69cf400d74e8343e0f5b8b428b1d07c6.tar.gz
fixing one leak, pointed by kmaraas
-rw-r--r--gnome-settings-daemon/ChangeLog5
-rw-r--r--gnome-settings-daemon/gnome-settings-keyboard-xkb.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gnome-settings-daemon/ChangeLog b/gnome-settings-daemon/ChangeLog
index e9f969e0c..5dd400d87 100644
--- a/gnome-settings-daemon/ChangeLog
+++ b/gnome-settings-daemon/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-27 Sergey V. Udaltsov <svu@gnome.org>
+
+ * gnome-settings-keyboard-xkb.c: fix one GSwitchItXkbConfig memory
+ leak, spotted by kmaraas.
+
2004-08-30 Carlos Garnacho Parro <carlosg@gnome.org>
* gnome-settings-multimedia-keys.c: applied patch from Pierre Ossman
diff --git a/gnome-settings-daemon/gnome-settings-keyboard-xkb.c b/gnome-settings-daemon/gnome-settings-keyboard-xkb.c
index bd7336d7b..79b2039f9 100644
--- a/gnome-settings-daemon/gnome-settings-keyboard-xkb.c
+++ b/gnome-settings-daemon/gnome-settings-keyboard-xkb.c
@@ -147,6 +147,7 @@ gnome_settings_keyboard_xkb_analyze_sysconfig (void)
{
GConfClient *confClient;
GSwitchItXkbConfig gswicWas, *pgswicNow;
+ gboolean isConfigChanged;
if (!initedOk)
return;
@@ -158,9 +159,10 @@ gnome_settings_keyboard_xkb_analyze_sysconfig (void)
GSwitchItXkbConfigLoadSysBackup (&gswicWas);
GSwitchItXkbConfigLoadInitial (pgswicNow);
+ isConfigChanged = g_slist_length (gswicWas.layouts) &&
+ !GSwitchItXkbConfigEquals (pgswicNow, &gswicWas);
/* config was changed!!! */
- if (g_slist_length (gswicWas.layouts) &&
- !GSwitchItXkbConfigEquals (pgswicNow, &gswicWas)) {
+ if (isConfigChanged) {
GtkWidget *msg = gtk_message_dialog_new_with_markup (NULL,
0,
GTK_MESSAGE_INFO,
@@ -183,6 +185,8 @@ gnome_settings_keyboard_xkb_analyze_sysconfig (void)
gtk_widget_show (msg);
}
GSwitchItXkbConfigSaveSysBackup (pgswicNow);
+ if (!isConfigChanged)
+ g_free (pgswicNow);
GSwitchItXkbConfigTerm (&gswicWas);
}