From 6ab5905a9bba9c2080dbc8b16f08f40b70886743 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Mon, 16 Jan 2023 09:15:24 +0100 Subject: [PATCH] call-window: Respect object lifecycle for signals --- src/calls-call-window.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/calls-call-window.c b/src/calls-call-window.c index 191e816..e66e555 100644 --- a/src/calls-call-window.c +++ b/src/calls-call-window.c @@ -285,20 +285,23 @@ calls_call_window_init (CallsCallWindow *self) self->calls = g_list_store_new (CALLS_TYPE_CALL_SELECTOR_ITEM); // Show errors in in-app-notification - g_signal_connect_swapped (calls_manager_get_default (), - "message", - G_CALLBACK (calls_in_app_notification_show), - self->in_app_notification); + g_signal_connect_object (calls_manager_get_default (), + "message", + G_CALLBACK (calls_in_app_notification_show), + self->in_app_notification, + G_CONNECT_SWAPPED); - g_signal_connect_swapped (calls_manager_get_default (), - "ui-call-added", - G_CALLBACK (add_call), - self); + g_signal_connect_object (calls_manager_get_default (), + "ui-call-added", + G_CALLBACK (add_call), + self, + G_CONNECT_SWAPPED); - g_signal_connect_swapped (calls_manager_get_default (), - "ui-call-removed", - G_CALLBACK (remove_call), - self); + g_signal_connect_object (calls_manager_get_default (), + "ui-call-removed", + G_CALLBACK (remove_call), + self, + G_CONNECT_SWAPPED); calls = calls_manager_get_calls (calls_manager_get_default ()); for (c = calls; c != NULL; c = c->next) {