Stop plugins on shutdown
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -296,6 +296,7 @@ public class RuneLite
|
||||
|
||||
public void shutdown()
|
||||
{
|
||||
pluginManager.stopCorePlugins();
|
||||
clientSessionManager.shutdown();
|
||||
discordService.close();
|
||||
executorService.shutdown();
|
||||
|
||||
@@ -214,6 +214,23 @@ public class PluginManager
|
||||
}
|
||||
}
|
||||
|
||||
public void stopCorePlugins()
|
||||
{
|
||||
List<Plugin> scannedPlugins = new ArrayList<>(plugins);
|
||||
for (Plugin plugin : scannedPlugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
stopPlugin(plugin);
|
||||
plugins.remove(plugin);
|
||||
}
|
||||
catch (PluginInstantiationException ex)
|
||||
{
|
||||
log.warn("Unable to stop plugin {}. {}", plugin.getClass().getSimpleName(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<Plugin> scanAndInstantiate(ClassLoader classLoader, String packageName) throws IOException
|
||||
{
|
||||
MutableGraph<Class<? extends Plugin>> graph = GraphBuilder
|
||||
|
||||
Reference in New Issue
Block a user