Exemplo n.º 1
0
        IByteBuffer Wrap(IByteBuffer buffer)
        {
            var         tracker      = new NoopResourceLeakTracker();
            IByteBuffer leakAwareBuf = this.Wrap(buffer, tracker);

            this.trackers.Enqueue(tracker);
            return(leakAwareBuf);
        }
Exemplo n.º 2
0
        internal sealed override IByteBuffer Wrap(CompositeByteBuffer buffer)
        {
            var tracker      = new NoopResourceLeakTracker();
            var leakAwareBuf = (WrappedCompositeByteBuffer)this.Wrap(buffer, tracker);

            this.trackers.Enqueue(tracker);
            return(leakAwareBuf);
        }
Exemplo n.º 3
0
        public override void Dispose()
        {
            base.Dispose();

            for (; ;)
            {
                NoopResourceLeakTracker tracker = null;
                if (this.trackers.Count > 0)
                {
                    tracker = this.trackers.Dequeue();
                }

                if (tracker == null)
                {
                    break;
                }

                Assert.True(tracker.Closed);
            }
        }