mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-07 09:50:28 +01:00
ip6: ensure manager singleton is cleared when disposed
This commit is contained in:
parent
7b3103b5eb
commit
8a59706712
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue