Open TheBoxyBear opened 3 months ago
Disposable objects should also be disposed rather than relying on the finalizer.
As finalizers have no guarantee of call order, it should only be used for freeing manually allocated resources - Not pass the call to the Dispose
of a owned managed object. However, all Dispose
paths should call GC.SuppressFinalize(this)
as per CA1816.
All types implementating
IDisposable
should follow the Dispose pattern, including a finalizer callingDispose(false)
to handle local unmanaged resources.