Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking for Objects that implement IDisposable but aren't properly disposed

Is there a way to automatically check existing C# source code for instances of objects that are not properly disposed of ie. using try / catch / finally or using statements? Or do I need to just manually look at the code?

like image 344
etoisarobot Avatar asked Apr 08 '10 19:04

etoisarobot


1 Answers

Take a look at FxCop for VS2010 - I believe they restored the DisposeObjectsBeforeLeavingScope rule - which may do exactly what you want.

like image 82
LBushkin Avatar answered Oct 14 '22 00:10

LBushkin