Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[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
- obj
Type: System. . :: . .Object
The object that a finalizer must not be called for.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.