ovs: don't leak a GCancellable on connection failure

Every time we clear priv->client we should also clear the cancellable
or it will be leaked.

Fixes: 830a5a14cb
This commit is contained in:
Beniamino Galvani 2019-02-10 13:41:37 +01:00
parent 139b9974fa
commit b92f2c9323

View file

@ -1308,6 +1308,7 @@ ovsdb_disconnect (NMOvsdb *self, gboolean is_disposing)
g_clear_object (&priv->client);
g_clear_object (&priv->conn);
g_clear_pointer (&priv->db_uuid, g_free);
nm_clear_g_cancellable (&priv->cancellable);
}
static void
@ -1540,9 +1541,6 @@ dispose (GObject *object)
g_clear_pointer (&priv->ports, g_hash_table_destroy);
g_clear_pointer (&priv->interfaces, g_hash_table_destroy);
g_cancellable_cancel (priv->cancellable);
g_clear_object (&priv->cancellable);
G_OBJECT_CLASS (nm_ovsdb_parent_class)->dispose (object);
}