Closed dscopra closed 7 years ago
E.g Task is an IDisposable but Disposing is not necessary: https://blogs.msdn.microsoft.com/pfxteam/2012/03/25/do-i-need-to-dispose-of-tasks/
Another example that should yield no diagnostics:
private static Stream OpenNetworkStream(IPAddress ip_address, int port) {
var listerner = new TcpListener(ip_address, port);
listerner.Start();
var socket = listerner.AcceptSocket();
return new NetworkStream(socket);
}
This is now part of issue #16
In some cases it is not needed to analyse the classes. E.g if you are creating a DesignViewModel in WPF, becauses these instances are never instantiated at runtime. Another cases is, when you are using factories, that track the instances they are creating. Then you have to release the instances to the factory and they will to the disposing for you.