mirror of
https://github.com/DanilaFe/abacus
synced 2024-11-04 18:08:31 -08:00
Clear caches on unload and call onUnload before plugins are removed.
This commit is contained in:
parent
44b8efd9bc
commit
6e1d2ce629
|
@ -185,15 +185,18 @@ public class PluginManager {
|
||||||
* Unloads all the plugins in the PluginManager.
|
* Unloads all the plugins in the PluginManager.
|
||||||
*/
|
*/
|
||||||
public void unload() {
|
public void unload() {
|
||||||
|
listeners.forEach(e -> e.onUnload(this));
|
||||||
Set<String> disabledPlugins = abacus.getConfiguration().getDisabledPlugins();
|
Set<String> disabledPlugins = abacus.getConfiguration().getDisabledPlugins();
|
||||||
for (Plugin plugin : plugins) {
|
for (Plugin plugin : plugins) {
|
||||||
if(disabledPlugins.contains(plugin.getClass().getName())) continue;
|
if(disabledPlugins.contains(plugin.getClass().getName())) continue;
|
||||||
plugin.disable();
|
plugin.disable();
|
||||||
}
|
}
|
||||||
|
cachedFunctions.clear();
|
||||||
|
cachedOperators.clear();
|
||||||
|
cachedNumbers.clear();
|
||||||
allFunctions.clear();
|
allFunctions.clear();
|
||||||
allOperators.clear();
|
allOperators.clear();
|
||||||
allNumbers.clear();
|
allNumbers.clear();
|
||||||
listeners.forEach(e -> e.onUnload(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user