r26721 - trunk/freenet/src/freenet/pluginmanager

[email protected]
Newsgroups gmane.network.freenet.cvs
Message-ID <[email protected]>
Author: toad
Date: 2009-04-10 17:26:48 +0000 (Fri, 10 Apr 2009)
New Revision: 26721

Modified:
   trunk/freenet/src/freenet/pluginmanager/PluginManager.java
Log:
Check that the plugin isn't already loaded after download


Modified: trunk/freenet/src/freenet/pluginmanager/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginManager.java	2009-04-10 17:23:13 UTC (rev 26720)
+++ trunk/freenet/src/freenet/pluginmanager/PluginManager.java	2009-04-10 17:26:48 UTC (rev 26721)
@@ -254,6 +254,7 @@
 				FredPlugin plug;
 				try {
 					plug = loadPlugin(pdl, filename);
+					if(plug == null) return; // Already loaded
 					pluginProgress.setProgress(PluginProgress.STARTING);
 					PluginInfoWrapper pi = PluginHandler.startPlugin(PluginManager.this, filename, plug, new PluginRespirator(node, PluginManager.this, plug));
 					synchronized(pluginWrappers) {
@@ -817,6 +818,11 @@
 						throw e;
 				}
 		}
+		
+		if(this.isPluginLoaded(filename)) {
+			Logger.error(this, "Plugin already loaded: "+filename);
+			return null;
+		}
 
 		/* now get the manifest file. */
 		JarFile pluginJarFile = null;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.