From 6fbabd51619c92bcd8584e1bb2f12f2b52904ea6 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sun, 28 Nov 2021 13:19:58 +0100 Subject: Use g_clear_pointer() and g_clear_object() --- applets/clock/calendar-window.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'applets/clock/calendar-window.c') diff --git a/applets/clock/calendar-window.c b/applets/clock/calendar-window.c index 8fe2c77c..11003d28 100644 --- a/applets/clock/calendar-window.c +++ b/applets/clock/calendar-window.c @@ -617,17 +617,15 @@ calendar_window_set_prefs_path (CalendarWindow *calwin, !strcmp (calwin->priv->prefs_path, prefs_path)) return; - if (calwin->priv->prefs_path) - g_free (calwin->priv->prefs_path); - calwin->priv->prefs_path = NULL; - + g_free (calwin->priv->prefs_path); if (prefs_path && prefs_path [0]) calwin->priv->prefs_path = g_strdup (prefs_path); + else + calwin->priv->prefs_path = NULL; g_object_notify (G_OBJECT (calwin), "prefs-path"); if (calwin->priv->settings) g_object_unref (calwin->priv->settings); - calwin->priv->settings = g_settings_new_with_path (CLOCK_SCHEMA, calwin->priv->prefs_path); } -- cgit v1.2.1