System.ComponentModel.Component.Dispose Method

Releases all resources used by the System.ComponentModel.Component.

Syntax

public void Dispose ()

Remarks

Call Component.Dispose when you are finished using the System.ComponentModel.Component. The Component.Dispose method leaves the System.ComponentModel.Component in an unusable state. After calling Component.Dispose, you must release all references to the System.ComponentModel.Component so the garbage collector can reclaim the memory that the System.ComponentModel.Component was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

Note:

Always call Component.Dispose before you release your last reference to the System.ComponentModel.Component. Otherwise, the resources it is using will not be freed until the garbage collector calls the System.ComponentModel.Component object's Finalize method.

Requirements

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