GroupPolicyObject.Dispose Method ()

 

Releases all resources used by the current instance of the GroupPolicyObject.

Namespace:   Microsoft.GroupPolicy
Assembly:  Microsoft.GroupPolicy.Management.Interop (in Microsoft.GroupPolicy.Management.Interop.dll)

Syntax

public void Dispose()
public:
virtual void Dispose() sealed
abstract Dispose : unit -> unit
override Dispose : unit -> unit
Public Sub Dispose

Implements

IDisposable.Dispose()

Remarks

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

Note

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

See Also

GroupPolicyObject Class
Microsoft.GroupPolicy Namespace

Return to top