System.GC.ReRegisterForFinalize Method

Requests that the system call the finalizer for the specified object for which GC.SuppressFinalize(object) has previously been called.

Syntax

public static void ReRegisterForFinalize (object obj)

Parameters

obj
The object that a finalizer must be called for.

Exceptions

TypeReason
ArgumentNullException obj is a null reference.
ExecutionEngineExceptionThe caller of this method is not the same as the object passed to this method.

Remarks

The GC.ReRegisterForFinalize(object) method adds the obj parameter to the list of objects that request finalization before the garbage collector frees the object. The obj parameter must be the caller of this method.

Calling the GC.ReRegisterForFinalize(object) method does not guarantee that the garbage collector will call an object's finalizer.

By default, all objects that implement finalizers are added to the list of objects that require finalization; however, an object might have already been finalized or might have disabled finalization by calling the GC.SuppressFinalize(object) method.

A finalizer can use this method to resurrect itself or an object that it references.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0