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:
Andrea Azzarone
2018-04-11 17:45:02 +02:00
committed by Andrea Azzarone
parent a83e119e34
commit 9d0b44d4e3
3 changed files with 2 additions and 11 deletions
-3
View File
@@ -1795,9 +1795,6 @@ gcal_month_view_finalize (GObject *object)
{
GcalMonthView *self = GCAL_MONTH_VIEW (object);
if (self->weather_service)
g_signal_handlers_disconnect_by_func (self->weather_service, weather_changed_cb, self);
g_clear_pointer (&self->date, g_free);
g_clear_pointer (&self->children, g_hash_table_destroy);
g_clear_pointer (&self->single_cell_children, g_hash_table_destroy);