Skip to content

Remove meaningless finalizers from library classes #526

Closed
@dosvidos

Description

@dosvidos

Many library classes feature meaningless finalizers that do nothing at runtime but grow the finalization queue and thus slow down GC and application performance.
This is especially concerning for frequently-used classes like SshCommand and Channel.
The library classes don't need finalizers as they aren't dealing with allocation and deallocation of unmanaged resource handles.
The nuances of a correct IDisposable implementation are neatly summarized here:
https://github.com/sidristij/dotnetbook/blob/master/book/en/LifetimeManagement/2-Disposable.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions