1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-13 16:07:36 +00:00

ringer: Move libfeedback related cleanup to finalize()

Leave the LfbEvent self->event alive in dispose()
to give potentially pending GAsyncReadyCallback invocations
or running GSources a better chance of finishing gracefully.
This commit is contained in:
Evangelos Ribeiro Tzaras 2022-08-18 20:57:46 +02:00
parent e28b15b41a
commit 97626c467f

View file

@ -463,10 +463,6 @@ dispose (GObject *object)
{ {
CallsRinger *self = CALLS_RINGER (object); CallsRinger *self = CALLS_RINGER (object);
if (self->event) {
g_clear_object (&self->event);
lfb_uninit ();
}
g_signal_handlers_disconnect_by_data (calls_manager_get_default (), self); g_signal_handlers_disconnect_by_data (calls_manager_get_default (), self);
g_clear_handle_id (&self->restart_id, g_source_remove); g_clear_handle_id (&self->restart_id, g_source_remove);
@ -475,6 +471,20 @@ dispose (GObject *object)
} }
static void
finalize (GObject *object)
{
CallsRinger *self = CALLS_RINGER (object);
if (self->event)
lfb_uninit ();
g_clear_object (&self->event);
G_OBJECT_CLASS (calls_ringer_parent_class)->finalize (object);
}
static void static void
calls_ringer_class_init (CallsRingerClass *klass) calls_ringer_class_init (CallsRingerClass *klass)
{ {
@ -482,6 +492,7 @@ calls_ringer_class_init (CallsRingerClass *klass)
object_class->constructed = constructed; object_class->constructed = constructed;
object_class->dispose = dispose; object_class->dispose = dispose;
object_class->finalize = finalize;
object_class->get_property = get_property; object_class->get_property = get_property;
props[PROP_IS_RINGING] = props[PROP_IS_RINGING] =