summaryrefslogtreecommitdiff
path: root/applets/clock/clock.c
diff options
context:
space:
mode:
authorzhuyaliang <[email protected]>2021-07-25 21:12:43 +0800
committerVictor Kareh <[email protected]>2021-07-28 07:59:54 -0400
commit633f79b08e2f2fe5e4c3195b2a983fa56b027e0c (patch)
tree928b6e721d6b45a6e3b2ebf0e57a5887ae102182 /applets/clock/clock.c
parent845b18be6cfaefa6ee5a0d7c695f5bb71aef7c5a (diff)
downloadmate-panel-633f79b08e2f2fe5e4c3195b2a983fa56b027e0c.tar.bz2
mate-panel-633f79b08e2f2fe5e4c3195b2a983fa56b027e0c.tar.xz
Fix clock applet add location crash
Diffstat (limited to 'applets/clock/clock.c')
-rw-r--r--applets/clock/clock.c4
1 files changed, 2 insertions, 2 deletions
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);