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
@@ -1095,13 +1095,7 @@ gcal_week_header_finalize (GObject *object)
|
||||
for (i = 0; i < 7; i++)
|
||||
g_list_free (self->events[i]);
|
||||
|
||||
if (self->weather_service != NULL)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (self->weather_service,
|
||||
(GCallback) on_weather_update,
|
||||
self);
|
||||
g_clear_object (&self->weather_service);
|
||||
}
|
||||
g_clear_object (&self->weather_service);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (self->weather_infos); i++)
|
||||
wid_clear (&self->weather_infos[i]);
|
||||
|
||||
Reference in New Issue
Block a user