diff options
author | Thomas Haller <thaller@redhat.com> | 2013-09-12 11:41:41 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2013-09-12 15:45:01 +0200 |
commit | d181a83d9a9988ae62a07aa09452b4278afb816f (patch) | |
tree | 0c6c6022596901f46791147ec69e72245d7899c7 | |
parent | 1e4b7c8ad0c9d1ad95b4dd6b5db0ad421c23c94b (diff) | |
download | network-manager-applet-d181a83d9a9988ae62a07aa09452b4278afb816f.tar.gz |
editor: initialize the destroy handler at last in eap_method_init/wireless_security_init
When 'eap_method_init' or 'wireless_security_init' fails to read the
UI xml file, it calls 'eap_method_unref' or 'wireless_security_unref',
respectively. The unref methods call the destroy handler, but they
should not do it in this case, because the objects were not fully
constructed.
Fix this, be setting the destroy handler only at the end of
the init methods.
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r-- | src/wireless-security/eap-method.c | 3 | ||||
-rw-r--r-- | src/wireless-security/wireless-security.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/wireless-security/eap-method.c b/src/wireless-security/eap-method.c index 23bedd71..28e2e051 100644 --- a/src/wireless-security/eap-method.c +++ b/src/wireless-security/eap-method.c @@ -158,7 +158,6 @@ eap_method_init (gsize obj_size, method->add_to_size_group = add_to_size_group; method->fill_connection = fill_connection; method->update_secrets = update_secrets; - method->destroy = destroy; method->default_field = default_field; method->phase2 = phase2; @@ -179,6 +178,8 @@ eap_method_init (gsize obj_size, } g_object_ref_sink (method->ui_widget); + method->destroy = destroy; + return method; } diff --git a/src/wireless-security/wireless-security.c b/src/wireless-security/wireless-security.c index 73315b1d..bd650fd0 100644 --- a/src/wireless-security/wireless-security.c +++ b/src/wireless-security/wireless-security.c @@ -182,7 +182,6 @@ wireless_security_init (gsize obj_size, sec->add_to_size_group = add_to_size_group; sec->fill_connection = fill_connection; sec->update_secrets = update_secrets; - sec->destroy = destroy; sec->default_field = default_field; sec->builder = gtk_builder_new (); @@ -203,6 +202,7 @@ wireless_security_init (gsize obj_size, } g_object_ref_sink (sec->ui_widget); + sec->destroy = destroy; sec->adhoc_compatible = TRUE; return sec; |