view: Auto disconnect weather-changed signal handler
Use g_signal_connect_object in order to auto disconnect the weather-changed signal handler when the view object is finalized. https://gitlab.gnome.org/GNOME/gnome-calendar/issues/271
This commit is contained in:
committed by
Andrea Azzarone
parent
a83e119e34
commit
9d0b44d4e3
@@ -218,7 +218,7 @@ gcal_view_set_weather_service_impl_helper (GcalWeatherService **old_service,
|
||||
g_set_object (old_service, new_service);
|
||||
|
||||
if (*old_service)
|
||||
g_signal_connect (*old_service, "weather-changed", weather_changed_cb, data);
|
||||
g_signal_connect_object (*old_service, "weather-changed", weather_changed_cb, data, 0);
|
||||
|
||||
update_func (data);
|
||||
g_object_notify (G_OBJECT (data), "weather-service");
|
||||
|
||||
Reference in New Issue
Block a user