gnome-control-center/0001-network-Keep-a-ref-on-NetDeviceEthernet-while-a-edit.patch

47 lines
1.9 KiB
Diff

From 711afc3a83ba32b62ea813bb5bd79fb96207ef61 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 28 Nov 2019 16:38:03 +0100
Subject: [PATCH] network: Keep a ref on NetDeviceEthernet while a edition
dialog is open
Otherwise, invoking other panel (eg. through shell search, or CLI) and
closing the dialog will result in a crash, as the NetDeviceEthernet
object does no longer exist.
---
panels/network/net-device-ethernet.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/panels/network/net-device-ethernet.c b/panels/network/net-device-ethernet.c
index a03fa8de3..b035ce81c 100644
--- a/panels/network/net-device-ethernet.c
+++ b/panels/network/net-device-ethernet.c
@@ -233,6 +233,7 @@ editor_done (NetConnectionEditor *editor,
{
g_object_unref (editor);
device_ethernet_refresh_ui (device);
+ g_object_unref (device);
}
static void
@@ -255,7 +256,7 @@ show_details (GtkButton *button, NetDeviceEthernet *device, const gchar *title)
editor = net_connection_editor_new (GTK_WINDOW (window), connection, nmdev, NULL, client);
if (title)
net_connection_editor_set_title (editor, title);
- g_signal_connect (editor, "done", G_CALLBACK (editor_done), device);
+ g_signal_connect (editor, "done", G_CALLBACK (editor_done), g_object_ref (device));
net_connection_editor_run (editor);
}
@@ -455,7 +456,7 @@ add_profile (GtkButton *button, NetDeviceEthernet *device)
nmdev = net_device_get_nm_device (NET_DEVICE (device));
editor = net_connection_editor_new (GTK_WINDOW (window), connection, nmdev, NULL, client);
- g_signal_connect (editor, "done", G_CALLBACK (editor_done), device);
+ g_signal_connect (editor, "done", G_CALLBACK (editor_done), g_object_ref (device));
net_connection_editor_run (editor);
}
--
2.24.0