-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule S3966: Objects should not be disposed more than once #209
Comments
So double dispose is explicitly supported by the I know I can disable this rule, but I fail to comprehend why you would make this a default? |
I suppose you blindy implemented CA2202 from FxCop, that Roslyn explicitly decided against porting (see dotnet/roslyn-analyzers#528). See http://blogs.msdn.com/b/tilovell/archive/2014/02/12/the-worst-code-analysis-rule-that-s-recommended-ca2202.aspx for a true rant. |
The example of non-compliant code you provide is incorrect. https://github.com/microsoft/referencesource/blob/master/mscorlib/system/io/streamwriter.cs For reference, here's the example you provide:
|
Hi @ericjohannsen, indeed, the rule description provides an incorrect example for non-compliant code. I've added an issue and you can follow the progress here: #3644 Thanks for your feedback! |
Considering the feedback received for this rule we decided to:
|
Implements RSPEC-3966: Objects should not be disposed more than once
Contributes to MMF-963.
The text was updated successfully, but these errors were encountered: