Share via


SuppressFinalize Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Requests that the system not call the finalizer for the specified object.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Shared Sub SuppressFinalize ( _
    obj As Object _
)
public static void SuppressFinalize(
    Object obj
)
public:
static void SuppressFinalize(
    Object^ obj
)
static member SuppressFinalize : 
        obj:Object -> unit 
public static function SuppressFinalize(
    obj : Object
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

obj is null Nothing nullptr unit a null reference (Nothing in Visual Basic) .

Remarks

This method sets a bit in the object header, which the system checks when calling finalizers. The obj parameter is required to be the caller of this method.

Objects that implement the IDisposable interface can call this method from the IDisposable..::..Dispose method to prevent the garbage collector from calling Object..::..Finalize on an object that does not require it.

.NET Framework Security

See Also

Reference

GC Class

System Namespace

ReRegisterForFinalize