System.Windows.Forms.WindowsFormsSynchronizationContext.Dispose Method

Releases all resources used by the System.Windows.Forms.WindowsFormsSynchronizationContext.

Syntax

public void Dispose ()

Remarks

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

Note:

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

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0