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 + + * gnome-settings-keyboard-xkb.c: fix one GSwitchItXkbConfig memory + leak, spotted by kmaraas. + 2004-08-30 Carlos Garnacho Parro * 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); }