forked from I2P_Developers/i2p.i2p
- Only stop a plugin at shutdown if it was running
This commit is contained in:
@ -4,7 +4,7 @@ import net.i2p.router.RouterContext;
|
|||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop all plugins that are installed
|
* Stop all plugins that are installed and running
|
||||||
*
|
*
|
||||||
* @since 0.7.13
|
* @since 0.7.13
|
||||||
* @author zzz
|
* @author zzz
|
||||||
@ -21,14 +21,14 @@ public class PluginStopper extends PluginStarter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop all plugins
|
* Stop all running plugins
|
||||||
* (whether or not they were ever started)
|
|
||||||
*
|
*
|
||||||
* this shouldn't throw anything
|
* this shouldn't throw anything
|
||||||
*/
|
*/
|
||||||
static void stopPlugins(RouterContext ctx) {
|
private static void stopPlugins(RouterContext ctx) {
|
||||||
Log log = ctx.logManager().getLog(PluginStopper.class);
|
Log log = ctx.logManager().getLog(PluginStopper.class);
|
||||||
for (String app : getPlugins()) {
|
for (String app : getPlugins()) {
|
||||||
|
if (isPluginRunning(app, ctx)) {
|
||||||
try {
|
try {
|
||||||
stopPlugin(ctx, app);
|
stopPlugin(ctx, app);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
@ -37,4 +37,5 @@ public class PluginStopper extends PluginStarter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user