[x] I have verified that I am running the latest version of DisposableFixer: 0.31
[x] I have searched open and closed issues to ensure it has not already been reported
Description
When using the protected virtual pattern for disposing, fields are detected as not disposed.
Source Code
public class ExampleManager : IExampleService, IDisposable
{
private readonly _db;
public ExampleManager()
{
_db = new ExampleEntities(); // This is detected as not disposed.
}
private bool disposing;
protected virtual void Dispose(bool disposing)
{
if (!disposing)
{
if (disposing)
{
_db.Dispose();
}
//Dispose of unmanaged resouces here
disposing = true;
}
}
~ExampleManager() {
Dispose(false);
}
public void Dispose()
{
Dispose(true);
}
}
Prerequisites
Description
When using the protected virtual pattern for disposing, fields are detected as not disposed.
Source Code