[network-manager-openvpn/nm-1-2] properties: fix editor's dispose() to be re-entrant



commit 22a67522da048ee50585202439d935843e2e9b13
Author: Thomas Haller <thaller redhat com>
Date:   Thu Apr 28 23:48:35 2016 +0200

    properties: fix editor's dispose() to be re-entrant
    
    (cherry picked from commit 3135bc66aec3d8810319c06ca6c5c0cd382434fb)

 properties/nm-openvpn.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/properties/nm-openvpn.c b/properties/nm-openvpn.c
index 1240d86..b98f036 100644
--- a/properties/nm-openvpn.c
+++ b/properties/nm-openvpn.c
@@ -569,20 +569,15 @@ dispose (GObject *object)
        OpenvpnEditor *plugin = OPENVPN_EDITOR (object);
        OpenvpnEditorPrivate *priv = OPENVPN_EDITOR_GET_PRIVATE (plugin);
 
-       if (priv->group)
-               g_object_unref (priv->group);
+       g_clear_object (&priv->group);
 
-       if (priv->window_group)
-               g_object_unref (priv->window_group);
+       g_clear_object (&priv->window_group);
 
-       if (priv->widget)
-               g_object_unref (priv->widget);
+       g_clear_object (&priv->widget);
 
-       if (priv->builder)
-               g_object_unref (priv->builder);
+       g_clear_object (&priv->builder);
 
-       if (priv->advanced)
-               g_hash_table_destroy (priv->advanced);
+       g_clear_pointer (&priv->advanced, g_hash_table_destroy);
 
        G_OBJECT_CLASS (openvpn_editor_plugin_widget_parent_class)->dispose (object);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]