1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-08 04:49:36 +00:00

main-window: Respect object lifecycle for signals

This commit is contained in:
Evangelos Ribeiro Tzaras 2023-01-16 09:14:58 +01:00
parent e168170f9e
commit 63d065118f

View file

@ -332,19 +332,22 @@ constructed (GObject *object)
CallsHistoryBox *history;
// 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 (),
"ussd-added",
G_CALLBACK (window_ussd_added_cb),
self);
g_signal_connect_swapped (calls_manager_get_default (),
"ussd-state-changed",
G_CALLBACK (window_update_ussd_state),
self);
g_signal_connect_object (calls_manager_get_default (),
"ussd-added",
G_CALLBACK (window_ussd_added_cb),
self,
G_CONNECT_SWAPPED);
g_signal_connect_object (calls_manager_get_default (),
"ussd-state-changed",
G_CALLBACK (window_update_ussd_state),
self,
G_CONNECT_SWAPPED);
gtk_window_set_transient_for (GTK_WINDOW (self->ussd_dialog), GTK_WINDOW (self));
// Add contacs box
@ -390,10 +393,11 @@ constructed (GObject *object)
g_object_unref (simple_action_group);
g_signal_connect_swapped (calls_manager_get_default (),
"notify::state",
G_CALLBACK (state_changed_cb),
self);
g_signal_connect_object (calls_manager_get_default (),
"notify::state",
G_CALLBACK (state_changed_cb),
self,
G_CONNECT_SWAPPED);
state_changed_cb (self, NULL, calls_manager_get_default ());