From 633f79b08e2f2fe5e4c3195b2a983fa56b027e0c Mon Sep 17 00:00:00 2001 From: zhuyaliang <15132211195@163.com> Date: Sun, 25 Jul 2021 21:12:43 +0800 Subject: Fix clock applet add location crash --- applets/clock/clock-location.c | 2 +- applets/clock/clock.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'applets') diff --git a/applets/clock/clock-location.c b/applets/clock/clock-location.c index 7ce1c129..e5b84bf1 100644 --- a/applets/clock/clock-location.c +++ b/applets/clock/clock-location.c @@ -92,7 +92,7 @@ clock_location_find_and_ref (GSList *locations, } if (l != NULL) - return g_object_ref (CLOCK_LOCATION (l->data)); + return CLOCK_LOCATION (l->data); else return NULL; } diff --git a/applets/clock/clock.c b/applets/clock/clock.c index f3c18d27..1b3480fe 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -2252,7 +2252,7 @@ location_start_element (GMarkupParseContext *context, if (current && clock_location_is_current_timezone (loc)) clock_location_make_current (loc, NULL, NULL, NULL); - data->cities = g_slist_append (data->cities, loc); + data->cities = g_slist_append (data->cities, g_object_ref (loc)); } static GMarkupParser location_parser = { @@ -2682,7 +2682,7 @@ run_prefs_edit_save (GtkButton *button, ClockData *cd) */ clock_location_is_current (loc); - cd->locations = g_slist_append (cd->locations, loc); + cd->locations = g_slist_append (cd->locations, g_object_ref (loc)); } g_free (name); g_free (city); -- cgit v1.2.1