Tutorial: Unsubscribe a module from all events during a soft restart
In order to save memory, you can disable modules or services that you do not use on your website. When less modules and services are load, startup times are faster.
If you need a mechanism for unsubscribing a module from all events, you can use the Unload method from the IModule interface.
When you deactivate a module in Sitefinity CMS, the Unload method is invoked during the unload process of the active module. This method is also invoked for every active module during a restart of the application.
Use the following code to unsubscribe a module: