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