diff options
author | Bastien Nocera <hadess@hadess.net> | 2018-03-11 22:56:14 +0100 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2018-03-12 13:32:53 -0300 |
commit | a1b8fa741fd89bd5d6fe7da75203529655e7da1d (patch) | |
tree | ca61c8800e252295c108c9cd0a0a47299fd5f281 | |
parent | d6a67d6accd32967590635357f4564f9e37f15b2 (diff) | |
download | gnome-control-center-a1b8fa741fd89bd5d6fe7da75203529655e7da1d.tar.gz |
network: Fix crash due to object name clashes in NM and g-c-c
1. open Wi-Fi Settings
2. Menu -> Known Wi-fi Networks
3. Click settings of some Wi-Fi network listed there.
4. Press escape twice to close all the dialogs
5. Menu -> Connect to Hidden network..,
Fix crashes when some object type names (WirelessSecurity and
EAPMethod in this case) are duplicated across the Network
panel and libnma.
Fixes a regression in commit 0470c04
https://bugzilla.gnome.org/show_bug.cgi?id=785099
3 files changed, 40 insertions, 3 deletions
diff --git a/panels/network/wireless-security/eap-method.c b/panels/network/wireless-security/eap-method.c index cb733e861..824f315a3 100644 --- a/panels/network/wireless-security/eap-method.c +++ b/panels/network/wireless-security/eap-method.c @@ -34,7 +34,19 @@ #include "utils.h" #include "helpers.h" -G_DEFINE_BOXED_TYPE (EAPMethod, eap_method, eap_method_ref, eap_method_unref) +GType +eap_method_get_type (void) +{ + static GType type_id = 0; + + if (!type_id) { + type_id = g_boxed_type_register_static ("CcEAPMethod", + (GBoxedCopyFunc) eap_method_ref, + (GBoxedFreeFunc) eap_method_unref); + } + + return type_id; +} GtkWidget * eap_method_get_widget (EAPMethod *method) diff --git a/panels/network/wireless-security/nm-connection-editor-to-network-panel.patch b/panels/network/wireless-security/nm-connection-editor-to-network-panel.patch index 0edabb1f9..ed9135cbb 100644 --- a/panels/network/wireless-security/nm-connection-editor-to-network-panel.patch +++ b/panels/network/wireless-security/nm-connection-editor-to-network-panel.patch @@ -1,3 +1,28 @@ +diff --git a/panels/network/wireless-security/eap-method.c b/panels/network/wireless-security/eap-method.c +index cb733e861..824f315a3 100644 +--- a/panels/network/wireless-security/eap-method.c ++++ b/panels/network/wireless-security/eap-method.c +@@ -34,7 +34,19 @@ + #include "utils.h" + #include "helpers.h" + +-G_DEFINE_BOXED_TYPE (EAPMethod, eap_method, eap_method_ref, eap_method_unref) ++GType ++eap_method_get_type (void) ++{ ++ static GType type_id = 0; ++ ++ if (!type_id) { ++ type_id = g_boxed_type_register_static ("CcEAPMethod", ++ (GBoxedCopyFunc) eap_method_ref, ++ (GBoxedFreeFunc) eap_method_unref); ++ } ++ ++ return type_id; ++} + + GtkWidget * + eap_method_get_widget (EAPMethod *method) diff --git a/panels/network/wireless-security/wireless-security.c b/panels/network/wireless-security/wireless-security.c index 23b8a27..bd233b0 100644 --- a/panels/network/wireless-security/wireless-security.c @@ -19,7 +44,7 @@ index 23b8a27..bd233b0 100644 + if (!type_id) { + g_resources_register (wireless_security_get_resource ()); + -+ type_id = g_boxed_type_register_static ("WirelessSecurity", ++ type_id = g_boxed_type_register_static ("CcWirelessSecurity", + (GBoxedCopyFunc) wireless_security_ref, + (GBoxedFreeFunc) wireless_security_unref); + } diff --git a/panels/network/wireless-security/wireless-security.c b/panels/network/wireless-security/wireless-security.c index 8c179a764..bbfb3ab17 100644 --- a/panels/network/wireless-security/wireless-security.c +++ b/panels/network/wireless-security/wireless-security.c @@ -37,7 +37,7 @@ wireless_security_get_type (void) if (!type_id) { g_resources_register (wireless_security_get_resource ()); - type_id = g_boxed_type_register_static ("WirelessSecurity", + type_id = g_boxed_type_register_static ("CcWirelessSecurity", (GBoxedCopyFunc) wireless_security_ref, (GBoxedFreeFunc) wireless_security_unref); } |