1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-11-17 16:09:32 -08:00

Clear caches on unload and call onUnload before plugins are removed.

This commit is contained in:
Danila Fedorin 2017-08-02 19:14:50 -07:00
parent 21150fa7a2
commit df94f698c3

View File

@ -185,15 +185,18 @@ public class PluginManager {
* Unloads all the plugins in the PluginManager.
*/
public void unload() {
listeners.forEach(e -> e.onUnload(this));
Set<String> disabledPlugins = abacus.getConfiguration().getDisabledPlugins();
for (Plugin plugin : plugins) {
if(disabledPlugins.contains(plugin.getClass().getName())) continue;
plugin.disable();
}
cachedFunctions.clear();
cachedOperators.clear();
cachedNumbers.clear();
allFunctions.clear();
allOperators.clear();
allNumbers.clear();
listeners.forEach(e -> e.onUnload(this));
}
/**