time-zone-monitor: Fix timezone leak on timezone changes

The old timezone was never being unref'ed before it got overwritten.
This commit is contained in:
Sebastian Keller
2021-04-11 00:27:08 +00:00
committed by Georges Basile Stavracas Neto
parent 899897c5fc
commit a0d24cd5d8
+1
View File
@@ -71,6 +71,7 @@ on_timedate1_proxy_properties_changed_cb (GcalTimeZoneMonitor *self,
if (timezone_variant)
timezone_identifier = g_variant_get_string (timezone_variant, NULL);
g_clear_pointer (&self->timezone, g_time_zone_unref);
self->timezone = g_time_zone_new_identifier (timezone_identifier);
g_debug ("System timezone is %s", g_time_zone_get_identifier (self->timezone));