Author: toad
Date: 2007-09-08 17:24:47 +0000 (Sat, 08 Sep 2007)
New Revision: 15060

Modified:
   trunk/freenet/src/freenet/pluginmanager/PluginHandler.java
Log:
Only tell the PluginInfoWrapper about the thread if the plugin is threaded.
Thread is probably a fairly heavy structure.

Modified: trunk/freenet/src/freenet/pluginmanager/PluginHandler.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginHandler.java  2007-09-08 
17:22:52 UTC (rev 15059)
+++ trunk/freenet/src/freenet/pluginmanager/PluginHandler.java  2007-09-08 
17:24:47 UTC (rev 15060)
@@ -22,11 +22,9 @@
        public static PluginInfoWrapper startPlugin(PluginManager pm, String 
filename, FredPlugin plug, PluginRespirator pr) {
                final PluginInfoWrapper pi = new PluginInfoWrapper(plug, 
filename);
                final PluginStarter ps = new PluginStarter(pr, pi);
-               pi.setThread(ps);
+               if(!pi.isThreadlessPlugin()) // No point otherwise
+                       pi.setThread(ps);

-               // This is an ugly trick... sorry ;o)
-               // The thread still exists as an identifier, but is never 
started if the
-               // plugin doesn't require it
                ps.setPlugin(pm, plug);
                // Run after startup
                // FIXME this is horrible, wastes a thread, need to make 
PluginStarter a Runnable 


Reply via email to