This member cannot be used in scripts, but is usable in the command bar and plugins.
This event fires immediately before the
Plugin is unloaded or reloaded via uninstallation,
Plugin/Deactivate|deactivation, or updating.
It enables a plugin to clean up after itself before its scripts stop running, e.g. to remove unnecessary instances from the
DataModel. If a plugin does not clean up properly, the old copies keep running alongside the new ones, causing issues like duplicate
PluginGui|guis and keybinds registering twice. When this occurs, users will be forced to close and reopen the place which is a bad user experience. It is not necessary to clean up plugin-related instances such as PluginButtons or DockWidgetPluginGuis because they will be automatically removed when the plugin is unloaded.
articles/Intro to Plugins, an introductory article to plugin use and development