Releases the resources used by the Package object.
protected virtual void Dispose (bool disposing);
abstract member Dispose : bool -> unit override this.Dispose : bool -> unit
Protected Overridable Sub Dispose (disposing As Boolean)
true if the object is being disposed,
false if it is being finalized.
Dispose method is called when the VSPackage is being destroyed by Visual Studio. This is typically in response to a call to Close. (Neither Visual Studio nor the Package class implements a finalizer. Unless a separate finalizer is implemented, the
Dispose method is always called with
disposing set to
A finalizer is a method that handles the destruction of unmanaged resources from within managed code. Finalizers run on a separate thread and impact the performance of the .NET Framework garbage collector, so you should avoid using them unnecessarily. For additional information on finalizers, see Finalize Methods and Destructors.
The default implementation of the
Dispose method performs the following tasks:
Unregisters any registered editor factories.
Disposes any editor factories that also implement the IDisposable interface.
Disposes all dialog pages.
Revokes all services.
Disposes any services that implement the IDisposable interface.
If you override the
Disposemethod, be sure to call
base.Disposefrom within the overriding method.