diff options
-rw-r--r-- | mate-panel/panel-profile.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c index cb334bcb..9a0df875 100644 --- a/mate-panel/panel-profile.c +++ b/mate-panel/panel-profile.c @@ -971,15 +971,18 @@ void panel_profile_remove_from_list (PanelGSettingsKeyType type, const char *id) { - gchar *key; + const gchar *key = NULL; + if (type == PANEL_GSETTINGS_TOPLEVELS) key = g_strdup (PANEL_TOPLEVEL_ID_LIST_KEY); else if (type == PANEL_GSETTINGS_OBJECTS) key = g_strdup (PANEL_OBJECT_ID_LIST_KEY); - - mate_gsettings_remove_all_from_strv (profile_settings, - key, - id); + + if (key != NULL) + mate_gsettings_remove_all_from_strv (profile_settings, + key, + id); + g_free (key); } @@ -1464,10 +1467,10 @@ panel_profile_delete_dir (PanelGSettingsKeyType type, g_free (subdir); } - if (dir != NULL) { - mate_dconf_recursive_reset (dir, NULL); - g_free (dir); - } + if (dir != NULL) { + mate_dconf_recursive_reset (dir, NULL); + g_free (dir); + } } static gboolean |