Share via


Object.Finalize Method

No longer supported or utilized.

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

Syntax

[DebuggerHiddenAttribute]
protected virtual void Finalize ()

Remarks

This method is no longer supported or utilized, starting with .NET Micro Framework version 4.0.

This method enables an instance (object) of the Object class to attempt to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

The Finalize method is protected and is therefore accessible only through the Object class or a class derived from Object.

The Finalize method is automatically called after an object becomes inaccessible, unless the object has been exempted from finalization by a call to the SuppressFinalize method. During the shutdown of an application domain, Finalize is automatically called on objects that are not exempt from finalization, even those that are still accessible. Note that Finalize is automatically called only once on a given object, unless the object is reregistered (such as by using the ReRegisterForFinalize method) and the SuppressFinalize method has not been subsequently called.

Every implementation of the Finalize method in a derived type must call its base type's implementation of Finalize. This is the only scenario in which application code is able to call Finalize.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, and 4.1.

See Also

Reference

Object Class
Object Members
System Namespace