summaryrefslogtreecommitdiff
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
parent845b18be6cfaefa6ee5a0d7c695f5bb71aef7c5a (diff)
downloadmate-panel-master.tar.bz2
mate-panel-master.tar.xz
Fix clock applet add location crashHEADmaster
-rw-r--r--applets/clock/clock-location.c2
-rw-r--r--applets/clock/clock.c4
2 files changed, 3 insertions, 3 deletions
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);