Interfaces should implement IDisposable - #1203
Merged
Merged
Conversation
Interfaces can only be implemented by GObject classes not records. Every class inherits from GObject.Object which implements IDisposable. So implementing IDisposable on interfaces is possible. In case of GirCore every instance of an object has a native counterpart. As the dotnet runtime does not know how big this native counterpart is the user should be able to explicitly dispose all instances which is easier if IDisposable is available on interfaces. Fixes: #1202
badcel
force-pushed
the
disposable-interfaces
branch
from
February 26, 2025 16:08
f294ebc to
5a92b02
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Interfaces can only be implemented by GObject classes not records. Every class inherits from GObject.Object which implements IDisposable. So implementing IDisposable on interfaces is possible.
In case of GirCore every instance of an object has a native counterpart. As the dotnet runtime does not know how big this native counterpart is the user should be able to explicitly dispose all instances which is easier if IDisposable is available on interfaces.
Fixes: #1202