Commit 4a58707b authored by Adam Gausmann's avatar Adam Gausmann

Merge branch '1.2.1-patch' into 'master'

Fix ConcurrentModificationException when plugins unload

See merge request !20
parents e74603bf ae173c24
Pipeline #7639684 passed with stages
in 37 seconds
......@@ -5,7 +5,7 @@
<parent>
<artifactId>samurai</artifactId>
<groupId>ninja.nonemu</groupId>
<version>1.2</version>
<version>1.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -6,7 +6,7 @@
<groupId>ninja.nonemu</groupId>
<artifactId>samurai</artifactId>
<version>1.2</version>
<version>1.2.1</version>
<modules>
<module>api</module>
<module>runtime</module>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>samurai</artifactId>
<groupId>ninja.nonemu</groupId>
<version>1.2</version>
<version>1.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -95,13 +95,16 @@ public class PluginManagerImpl implements PluginManager {
public void cleanup() {
logger.trace("Cleaning up plugin manager");
plugins.keySet().iterator().forEachRemaining((name) -> {
String[] pluginNames = new String[plugins.size()];
plugins.keySet().toArray(pluginNames);
for (String pluginName : pluginNames) {
try {
unregisterPlugin(name);
unregisterPlugin(pluginName);
} catch (Exception e) {
logger.error("Plugin threw an exception while cleaning up", e);
}
});
}
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment