From ddab47d28836fe71a4f2cb140f3ab91031c84f6d Mon Sep 17 00:00:00 2001 From: "Eugenio Paolantonio (g7)" Date: Sat, 9 Jan 2021 18:15:34 +0100 Subject: [PATCH] ofono: call: ensure signals get disconnected on voice_call object destruction The 'property-changed' and 'disconnect-reason' signals weren't disconnected on the voice_call object cleanup, and callbacks would thus still be fired once a second call happens, resulting in a crash. Signed-off-by: Eugenio Paolantonio (g7) --- plugins/ofono/calls-ofono-call.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/ofono/calls-ofono-call.c b/plugins/ofono/calls-ofono-call.c index c835cda..557cf8a 100644 --- a/plugins/ofono/calls-ofono-call.c +++ b/plugins/ofono/calls-ofono-call.c @@ -310,10 +310,12 @@ constructed (GObject *object) g_return_if_fail (self->voice_call != NULL); - g_signal_connect_swapped (self->voice_call, "property-changed", - G_CALLBACK (property_changed_cb), self); - g_signal_connect_swapped (self->voice_call, "disconnect-reason", - G_CALLBACK (disconnect_reason_cb), self); + g_signal_connect_object (self->voice_call, "property-changed", + G_CALLBACK (property_changed_cb), + self, G_CONNECT_SWAPPED); + g_signal_connect_object (self->voice_call, "disconnect-reason", + G_CALLBACK (disconnect_reason_cb), + self, G_CONNECT_SWAPPED); G_OBJECT_CLASS (calls_ofono_call_parent_class)->constructed (object); }