From 74b1296d074263da019f329c21f7957d38b1946e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20G=C3=B6llnitz?= Date: Wed, 10 Jan 2024 08:49:50 +0100 Subject: [PATCH] month-cell: hold weather service while this widget exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Markus Göllnitz --- src/gui/gcal-weather-settings.c | 1 - src/gui/views/gcal-month-cell.c | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/gcal-weather-settings.c b/src/gui/gcal-weather-settings.c index 855baecb..3744c639 100644 --- a/src/gui/gcal-weather-settings.c +++ b/src/gui/gcal-weather-settings.c @@ -202,7 +202,6 @@ manage_weather_service (GcalWeatherSettings *self) } gcal_weather_service_set_location (weather_service, location); - gcal_weather_service_hold (weather_service); gcal_weather_service_activate (weather_service); } else diff --git a/src/gui/views/gcal-month-cell.c b/src/gui/views/gcal-month-cell.c index 4c1adcb6..cf497006 100644 --- a/src/gui/views/gcal-month-cell.c +++ b/src/gui/views/gcal-month-cell.c @@ -293,6 +293,9 @@ gcal_month_cell_finalize (GObject *object) { GcalMonthCell *self = (GcalMonthCell *)object; + GcalWeatherService *weather_service = gcal_context_get_weather_service (self->context); + gcal_weather_service_release (weather_service); + gcal_clear_date_time (&self->date); g_clear_object (&self->context); @@ -497,6 +500,9 @@ gcal_month_cell_set_context (GcalMonthCell *self, self, 0); + GcalWeatherService *weather_service = gcal_context_get_weather_service (self->context); + gcal_weather_service_hold (weather_service); + update_weather (self); g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CONTEXT]);