Commit cc4cd4c8 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Slightly better unload logic.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@4182 b35dd754-fafc-0310-a699-88a17e54d16e
parent 251f2b69
......@@ -796,14 +796,18 @@ public class PluginManager {
// needs to be unloaded and then reloaded.
else if (jarFile.lastModified() > dir.lastModified()) {
unloadPlugin(pluginName);
// Give the plugin 2 seconds to unload.
Thread.sleep(2000);
// Ask the system to clean up references.
System.gc();
int count = 0;
while (!deleteDir(dir) && count < 5) {
Log.warn("Error unloading plugin " + pluginName + ". " +
"Will attempt again momentarily.");
Thread.sleep(10000);
Thread.sleep(8000);
count++;
// Ask the system to clean up references.
System.gc();
}
// Now unzip the plugin.
unzipPlugin(pluginName, jarFile, dir);
......
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