Skip to content
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

Validate implementations of IDisposable #81

Open
TheBoxyBear opened this issue Jul 28, 2024 · 2 comments
Open

Validate implementations of IDisposable #81

TheBoxyBear opened this issue Jul 28, 2024 · 2 comments
Milestone

Comments

@TheBoxyBear
Copy link
Owner

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

@TheBoxyBear TheBoxyBear added this to the Release milestone Jul 28, 2024
@TheBoxyBear
Copy link
Owner Author

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

@TheBoxyBear
Copy link
Owner Author

TheBoxyBear commented Sep 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant