确定IDisposable的对象 [英] Identify IDisposable objects
问题描述
我要检讨,有一些内存泄漏的其他人做了一个代码。现在我正在寻找一次性物品的使用语句enclause他们,我想知道是否有一个快速的方法,告诉你一切。我的意思是像ReSharper的或其他的Visual Studio插件。宣布一次性对象
i have to review a code made by some other person that has some memory leaks. Right now i'm searching the disposable objects to enclause them with the using statement and i would like to know if there is a quick way that tells you all the disposable objects declared in. I mean something like resharper or another visual studio plugin.
感谢。
推荐答案
我知道你的意思。我不知道,但看的FxCop。它可能在有规则的地方,检查是否实现IDisposable的对象不处理。 ,只是一种预感,心中
I know what you mean. I don't know, but look at FxCop. It might have a rule in there somewhere that checks whether objects implementing IDisposable are not disposed. Just a hunch, mind.
更新:米奇小麦写道:
的FxCop包括规则,这就是说,从实现IDisposable应该实现派生类型所有类型的Dispose()模式
FxCop includes the rule, thats says all types that derive from types that implement IDisposable should implement the Dispose() pattern
谢谢你,米奇。
这篇关于确定IDisposable的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!