network/net-device-ethernet: Disconnect from NMConnection signals
Otherwise we'll crash in our handler if the signal fires after we're finalized i.e. user leaves the network panel. https://bugzilla.gnome.org/show_bug.cgi?id=708468
This commit is contained in:
parent
8dc9336f52
commit
d8bfc9e937
1 changed files with 11 additions and 0 deletions
|
@ -605,9 +605,20 @@ static void
|
||||||
device_ethernet_finalize (GObject *object)
|
device_ethernet_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
NetDeviceEthernet *device = NET_DEVICE_ETHERNET (object);
|
NetDeviceEthernet *device = NET_DEVICE_ETHERNET (object);
|
||||||
|
GSList *connections, *l;
|
||||||
|
|
||||||
g_object_unref (device->builder);
|
g_object_unref (device->builder);
|
||||||
|
|
||||||
|
connections = net_device_get_valid_connections (NET_DEVICE (device));
|
||||||
|
for (l = connections; l; l = l->next) {
|
||||||
|
NMConnection *connection = l->data;
|
||||||
|
if (g_object_get_data (G_OBJECT (connection), "removed_signal_handler")) {
|
||||||
|
g_signal_handlers_disconnect_by_func (connection, connection_removed, device);
|
||||||
|
g_object_set_data (G_OBJECT (connection), "removed_signal_handler", NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
g_slist_free (connections);
|
||||||
|
|
||||||
G_OBJECT_CLASS (net_device_ethernet_parent_class)->finalize (object);
|
G_OBJECT_CLASS (net_device_ethernet_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue