ip6: ensure manager singleton is cleared when disposed
authorDan Williams <dcbw@redhat.com>
Sat, 1 May 2010 00:30:11 +0000 (17:30 -0700)
committerDan Williams <dcbw@redhat.com>
Sat, 1 May 2010 00:30:11 +0000 (17:30 -0700)
src/ip6-manager/nm-ip6-manager.c

index ca532e3..b9b5639 100644 (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);
 }