itinero / reminiscence

A library for cross-platform memory mapping.
MIT License
9 stars 6 forks source link

Implement the standard IDisposable pattern in unsealed classes #16

Open airbreather opened 5 years ago

airbreather commented 5 years ago

A few classes implement System.IDisposable, but they do so without using the standard pattern. See CA1063:ImplementIDisposableCorrectly, including its "See Also" links, for a description of this pattern.

I'm wrapping up what I intend to submit for the native memory array implementation, and in my self-review, I noticed that I don't have a finalizer on the type, which got me thinking about this.

The types I see that directly implement System.IDisposable are:

juliusfriedman commented 4 years ago

https://github.com/juliusfriedman/net7mma_core/blob/master/Common/Classes/Disposables/BaseDisposable.cs

Something like that could be adapted?