Share via


Declarations.Dispose Method

Definition

Frees any resources allocated by the class just before the class object is destroyed.

public:
 virtual void Dispose();
public:
 virtual void Dispose();
 virtual void Dispose();
public virtual void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Overridable Sub Dispose ()

Implements

Remarks

Call <xref:Namespace.Class.Dispose%2A> when you are finished using the Declarations. The <xref:Namespace.Class.Dispose%2A> method leaves the Declarations in an unusable state. After calling <xref:Namespace.Class.Dispose%2A>, you must release all references to the Declarations so the garbage collector can reclaim the memory that the Declarations was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

Note

Always call <xref:Namespace.Class.Dispose%2A> before you release your last reference to the Declarations. Otherwise, the resources it is using will not be freed until the garbage collector calls the Declarations object's Finalize method.

Applies to