Blame SOURCES/0001-network-Keep-a-ref-on-NetDeviceEthernet-while-a-edit.patch

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