C#

C#

Made by DeepSource

Do not declare finalizers for types derived from MemoryManager<T> CS-W1052

Bug risk
Critical
Autofix

The MemoryManager<T> class allows you to manage memory and the buffer holding the items of the type T. Adding a finalizer to the type deriving MemoryManager<T> may allow memory to be reclaimed or freed while still in use internally. Consider removing the said finalizer.

Bad Practice

Class C : MemoryManager<T>
{
    // ...

    ~C()
    {
    }
}

Recommended

Class C : MemoryManager<T>
{
    // ...
}

Reference