BADF00D / DisposableFixer

This is a Visual Studio Extension and NuGet package that should identify and fix problems as memleaks while using IDisposables.
Other
35 stars 7 forks source link

Wrap in using does nothing #111

Closed BADF00D closed 5 years ago

BADF00D commented 5 years ago

Prerequisites

Description

Source Code

using System.IO;
using System.Xml;
using System.Xml.Linq;

namespace RxTimeoutTest
{
    internal class SomeClass
    {
        public void Exchange()
        {
            var doc = XDocument.Load(new StringReader("<?xml><list></list>"));
            var mgr = new XmlNamespaceManager(doc.CreateReader()?.NameTable ?? new NameTable());
            mgr.AddNamespace("a", "bla");
        }
    }
}

Screenshot

2019-03-13_13-25-23