month-cell: hold weather service while this widget exists

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
This commit is contained in:
Markus Göllnitz
2024-01-27 16:09:02 +00:00
committed by Georges Basile Stavracas Neto
parent cf40734243
commit 74b1296d07
2 changed files with 6 additions and 1 deletions
-1
View File
@@ -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
+6
View File
@@ -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]);