E.3. Disposing Data When the Plugin Is Unloaded

If the plugin defines a function called UNLOAD, this function will be called when the plugin is unloaded. Currently this happens only when the World that loaded the plugin is closed.

If your plugin must dispose of anything it created that would be kept behind even when the World is closed, the UNLOAD function is the place to do that.