Skip to content

Comments

remove redundant dispose code in SafeDataReader#4607

Closed
SimonCropp wants to merge 3 commits intoMarimerLLC:mainfrom
SimonCropp:remove-redundant-dispose-code-in-SafeDataReader
Closed

remove redundant dispose code in SafeDataReader#4607
SimonCropp wants to merge 3 commits intoMarimerLLC:mainfrom
SimonCropp:remove-redundant-dispose-code-in-SafeDataReader

Conversation

@SimonCropp
Copy link
Contributor

No description provided.

Copy link
Contributor

@StefanOssendorf StefanOssendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is public and has to implement Dispose. Why do you remove the default implementation code for IDisposable for classes which can be derived from?

I don't know if this is actually used in the wild but it's public and someone deriving from this class must have a way to add code to the disposing.
So I'm against this change.

@SimonCropp
Copy link
Contributor Author

the Dispose(bool disposing) and destructor pattern is the approach for cleaning up unmanaged resources. for types with only managed resources a single dispose approach is sufficient

@StefanOssendorf
Copy link
Contributor

That's right. But we don't know what a user of our class does. So we should provide the necessary hook to participate in a proper disposal, no?

@SimonCropp SimonCropp deleted the remove-redundant-dispose-code-in-SafeDataReader branch March 30, 2025 22:30
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

Successfully merging this pull request may close these issues.

3 participants