Exemplo n.º 1
0
        public override void Clear()
        {
            if (Count == 0)
            {
                return;
            }

            _traversalActions.SetActions(postAction: n =>
            {
                n.Dispose();
                return(true);
            });

            // Start Dispose from the last node (postAction)
            _consolidateRoots.Sift(_traversalActions);

            foreach (var root in GetRoots())
            {
                root.Sift(_traversalActions);
            }

            _roots.Clear();
            _minNode          = null;
            _consolidateRoots = null;
            Count             = 0;
        }