Sdílet prostřednictvím


GC.ReRegisterForFinalize Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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

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

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Shared Sub ReRegisterForFinalize ( _
    obj As Object _
)
[SecuritySafeCriticalAttribute]
public static void ReRegisterForFinalize(
    Object obj
)

Parameters

  • obj
    Type: System.Object
    The object that a finalizer must be called for.

Exceptions

Exception Condition
ArgumentNullException

obj is nulla null reference (Nothing in Visual Basic).

Remarks

The ReRegisterForFinalize 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 ReRegisterForFinalize 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 SuppressFinalize method.

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

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.