[network-manager-applet: 2/6] wireless-security: don't reference WirelessSecurity from EAP methods
- From: Beniamino Galvani <bgalvani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet: 2/6] wireless-security: don't reference WirelessSecurity from EAP methods
- Date: Tue, 3 Jan 2017 14:53:44 +0000 (UTC)
commit 39bf39a394f94619d1135d48968704c09924c98b
Author: Beniamino Galvani <bgalvani redhat com>
Date: Thu Dec 22 17:57:11 2016 +0100
wireless-security: don't reference WirelessSecurity from EAP methods
This causes memory leaks as the WirelessSecurity is never freed due to
circular references: WirelessSecurity references the EAPMethods
through the combo box model, and EAPMethods reference the
WirelessSecurity back.
EAP methods are instantiated by the WirelessSecurity and are supposed
to have a lifetime not longer than the WirelessSecurity's (as they are
hooked in the combo box model and destroyed when the WS is disposed),
so the reference is not needed.
src/wireless-security/eap-method-leap.c | 4 +---
src/wireless-security/eap-method-simple.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/wireless-security/eap-method-leap.c b/src/wireless-security/eap-method-leap.c
index 2872084..2448df2 100644
--- a/src/wireless-security/eap-method-leap.c
+++ b/src/wireless-security/eap-method-leap.c
@@ -183,8 +183,6 @@ destroy (EAPMethod *parent)
g_signal_handlers_disconnect_by_func (G_OBJECT (widget),
(GCallback) widgets_unrealized,
method);
-
- wireless_security_unref (method->ws_parent);
}
EAPMethodLEAP *
@@ -213,7 +211,7 @@ eap_method_leap_new (WirelessSecurity *ws_parent,
parent->password_flags_name = NM_SETTING_802_1X_PASSWORD;
method = (EAPMethodLEAP *) parent;
method->editing_connection = secrets_only ? FALSE : TRUE;
- method->ws_parent = wireless_security_ref (ws_parent);
+ method->ws_parent = ws_parent;
widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_leap_notebook"));
g_assert (widget);
diff --git a/src/wireless-security/eap-method-simple.c b/src/wireless-security/eap-method-simple.c
index 0517727..feee1b8 100644
--- a/src/wireless-security/eap-method-simple.c
+++ b/src/wireless-security/eap-method-simple.c
@@ -286,8 +286,6 @@ destroy (EAPMethod *parent)
g_source_remove (method->idle_func_id);
method->idle_func_id = 0;
}
-
- wireless_security_unref (method->ws_parent);
}
EAPMethodSimple *
@@ -316,7 +314,7 @@ eap_method_simple_new (WirelessSecurity *ws_parent,
parent->password_flags_name = NM_SETTING_802_1X_PASSWORD;
method = (EAPMethodSimple *) parent;
- method->ws_parent = wireless_security_ref (ws_parent);
+ method->ws_parent = ws_parent;
method->flags = flags;
method->type = type;
g_assert (type < EAP_METHOD_SIMPLE_TYPE_LAST);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]