ip6: ensure manager singleton is cleared when disposed

This commit is contained in:
Dan Williams 2010-04-30 17:30:11 -07:00
parent 7b3103b5eb
commit 8a59706712

View file

@ -941,11 +941,11 @@ nm_ip6_manager_new (void)
return manager;
}
static NMIP6Manager *singleton = NULL;
NMIP6Manager *
nm_ip6_manager_get (void)
{
static NMIP6Manager *singleton = NULL;
if (!singleton) {
singleton = nm_ip6_manager_new ();
g_assert (singleton);
@ -990,6 +990,8 @@ finalize (GObject *object)
nl_cache_free (priv->addr_cache);
nl_cache_free (priv->route_cache);
singleton = NULL;
G_OBJECT_CLASS (nm_ip6_manager_parent_class)->finalize (object);
}