netlink: don't ref/unref the singleton

This commit is contained in:
Pavel Šimerda 2013-03-13 21:52:17 +01:00
parent d9e87d933b
commit 363dece23b
5 changed files with 1 additions and 19 deletions

View file

@ -1654,7 +1654,6 @@ finalize (GObject *object)
g_signal_handler_disconnect (priv->monitor, priv->netlink_id);
g_hash_table_destroy (priv->devices);
g_object_unref (priv->monitor);
nl_cache_free (priv->addr_cache);
nl_cache_free (priv->route_cache);

View file

@ -725,11 +725,6 @@ dispose (GObject *object)
priv->netlink_id = 0;
}
if (priv->monitor) {
g_object_unref (priv->monitor);
priv->monitor = NULL;
}
g_free (priv->nas_ifname);
priv->nas_ifname = NULL;

View file

@ -572,8 +572,6 @@ dispose (GObject *object)
if (priv->link_disconnected_id)
g_signal_handler_disconnect (priv->monitor, priv->link_disconnected_id);
g_object_unref (priv->monitor);
g_signal_handler_disconnect (priv->parent, priv->parent_state_id);
g_object_unref (priv->parent);

View file

@ -344,11 +344,6 @@ dispose (GObject *object)
priv->link_disconnected_id = 0;
}
if (priv->monitor) {
g_object_unref (priv->monitor);
priv->monitor = NULL;
}
G_OBJECT_CLASS (nm_device_wired_parent_class)->dispose (object);
}

View file

@ -704,7 +704,6 @@ nm_netlink_get_default_handle (void)
self = nm_netlink_monitor_get ();
nlh = NM_NETLINK_MONITOR_GET_PRIVATE (self)->nlh_sync;
g_object_unref (self);
return nlh;
}
@ -723,7 +722,6 @@ nm_netlink_iface_to_index (const char *iface)
nl_cache_refill (priv->nlh_sync, priv->link_cache);
idx = rtnl_link_name2i (priv->link_cache, iface);
g_object_unref (self);
return idx;
}
@ -758,7 +756,6 @@ nm_netlink_index_to_iface (int idx)
buf = NULL;
}
g_object_unref (self);
return buf;
}
@ -777,7 +774,6 @@ nm_netlink_index_to_rtnl_link (int idx)
nl_cache_refill (priv->nlh_sync, priv->link_cache);
ret = rtnl_link_get (priv->link_cache, idx);
g_object_unref (self);
return ret;
}
@ -807,8 +803,7 @@ nm_netlink_monitor_get (void)
g_object_unref (singleton);
singleton = NULL;
}
} else
g_object_ref (singleton);
}
return singleton;
}