TheBoxyBear / charttools

Library for editing Clone Hero song files in .NET
https://theboxybear.github.io/charttools
GNU General Public License v3.0
13 stars 5 forks source link

Validate implementations of IDisposable #81

Open TheBoxyBear opened 3 months ago

TheBoxyBear commented 3 months ago

All types implementating IDisposable should follow the Dispose pattern, including a finalizer calling Dispose(false) to handle local unmanaged resources.

TheBoxyBear commented 3 months ago

Disposable objects should also be disposed rather than relying on the finalizer.

TheBoxyBear commented 2 months ago

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.