CodeCracker is not currently considering the dispose pattern, as it ignores the void Dispose(bool) method.
Dispose pattern: https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern
CodeCracker will output a CC0033 even if the field is disposed:
class C : System.IDisposable
{
private System.IDisposable d = new System.IO.MemoryStream();
public void Dispose()
{
Dispose(true);
System.GC.SuppressFinalize(this);
}
public void Dispose(bool disposing)
{
if (disposing && d != null)
d.Dispose();
}
}
CodeCracker only checks for void Dispose(), we should add void Dispose(bool).
This code should generate a CC0033 only if there is no call to dispose on the field in the method.
CodeCracker is not currently considering the dispose pattern, as it ignores the
void Dispose(bool)method.Dispose pattern: https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern
CodeCracker will output a CC0033 even if the field is disposed:
CodeCracker only checks for
void Dispose(), we should addvoid Dispose(bool).This code should generate a CC0033 only if there is no call to dispose on the field in the method.