From 9cd9c97faf065067c0c2a32695fa7123b9330a1a Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 4 Jan 2021 02:42:46 +0100 Subject: netspeed-preferences: disconnect a signal handler on finalize --- netspeed/src/netspeed-preferences.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'netspeed/src') diff --git a/netspeed/src/netspeed-preferences.c b/netspeed/src/netspeed-preferences.c index 7ed05a3b..ac2d78b9 100644 --- a/netspeed/src/netspeed-preferences.c +++ b/netspeed/src/netspeed-preferences.c @@ -54,12 +54,6 @@ netspeed_preferences_init (NetspeedPreferences *preferences) gtk_widget_init_template (GTK_WIDGET (preferences)); } -static void -netspeed_preferences_finalize (GObject *object) -{ - G_OBJECT_CLASS (netspeed_preferences_parent_class)->finalize (object); -} - static void netspeed_preferences_set_property (GObject *object, guint property_id, @@ -150,6 +144,16 @@ on_network_device_combo_changed (GtkComboBox *combo, "auto-change-device", auto_change_device); } +static void +netspeed_preferences_finalize (GObject *object) +{ + NetspeedPreferences *self = NETSPEED_PREFERENCES (object); + g_signal_handlers_disconnect_by_func (self->network_device_combo, + on_network_device_combo_changed, + self); + G_OBJECT_CLASS (netspeed_preferences_parent_class)->finalize (object); +} + static void netspeed_preferences_class_init (NetspeedPreferencesClass *klass) { -- cgit v1.2.1