ServiceBase.Dispose Method (Boolean)
Disposes of the resources (other than memory) used by the ServiceBase.
Assembly: System.ServiceProcess (in System.ServiceProcess.dll)
Call ServiceBase class) when you are finished using the derived class. The method leaves the derived class in an unusable state. After calling , you must release all references to the derived class and ServiceBase so the memory they were occupying can be reclaimed by garbage collection.in your derived class (and through it, in the
OnStop is often implemented to process the code in OnPause, combined with a call to . If you choose to do this in your derived class, it is customary to implement OnStart to allocate whatever released.
Available since 1.1