-
Notifications
You must be signed in to change notification settings - Fork 899
Remove unnecessary finalizers #330
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
Conversation
I added a second commit to this. The finalizer in |
Hey @sharwell, thanks a lot for bringing this on the table. Both Joe Duffy and Stephen Toub seem to back up this proposal. @phkelley @xpaulbettsx Any opinion? |
@nulltoken Full ✨, only classes that directly have to free handles or memory should have finalizers. Finalizers are CrazyTown™ and should be avoided unless they're definitely needed |
@sharwell Full ✨ then! ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ Thanks a lot for your recent contributions. Merged! |
After this change I'm seeing a bunch of warnings for
|
I think @yorah has a fix for these. Something about the parents of the commits being enumerated twice but disposed only once. |
This commit did not cause those warnings, but rather prevented code from incorrectly suppressing the warnings which should have been reported the whole time. |
@sharwell I know. Thanks for helping us putting those under the light ❤️ |
I didn't mean to suggest you had caused them, I just wanted to make sure I wasn't the only person that had noticed. 😊 |
I never take things like that personally. You did track the message down to a relevant commit; I merely gave you the next link in the chain to follow. :) |
Yes, I have a few fixes for those messages coming up in another PR (hopefully today). |
This class does not own any unmanaged resources, so adding a finalizer increases GC overhead for the class without any benefits. The
GitObjectSafeHandle
already provides guaranteed cleanup.