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:
@@ -463,10 +463,6 @@ dispose (GObject *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_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
|
||||
calls_ringer_class_init (CallsRingerClass *klass)
|
||||
{
|
||||
@@ -482,6 +492,7 @@ calls_ringer_class_init (CallsRingerClass *klass)
|
||||
|
||||
object_class->constructed = constructed;
|
||||
object_class->dispose = dispose;
|
||||
object_class->finalize = finalize;
|
||||
object_class->get_property = get_property;
|
||||
|
||||
props[PROP_IS_RINGING] =
|
||||
|
||||
Reference in New Issue
Block a user