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

Add warning if return type hides IDisposable interface #119

Closed BADF00D closed 5 years ago

BADF00D commented 5 years ago

Prerequisites

Description

If a factory method creates an IDisposable-Instance, but the return type does not implement IDisposable, then there should be a warning. The caller of the method has no clue, that the result should be disposed.

Source Code

using System.IO;

namespace DisposableFixer.Test
{
    public class Dummy
    {
        public object CreateMemoryStream()
        {
            return new MemoryStream();
        }
    }
}

Screenshot

uqiLUig7Qr