Author: toad
Date: 2009-03-24 16:48:32 +0000 (Tue, 24 Mar 2009)
New Revision: 26160

Modified:
   branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java
Log:
container will be null in onCancelled(), so use runBlocking not queue to ensure 
that if we are being cancelled from the database thread, we remove immediately; 
not doing so results in a leak


Modified: branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java   
2009-03-24 16:46:17 UTC (rev 26159)
+++ branches/db4o/freenet/src/freenet/client/async/USKFetcherTag.java   
2009-03-24 16:48:32 UTC (rev 26160)
@@ -124,7 +124,9 @@
                        finished = true;
                }
                if(persistent) {
-                       context.jobRunner.queue(new DBJob() {
+                       // If cancelled externally, and this function is called 
from USKFetcher,
+                       // container may be null even though we are running on 
the database thread
+                       context.jobRunner.runBlocking(new DBJob() {
 
                                public void run(ObjectContainer container, 
ClientContext context) {
                                        container.activate(callback, 1);
@@ -133,7 +135,7 @@
                                        container.deactivate(callback, 1);
                                }
                                
-                       }, NativeThread.HIGH_PRIORITY, false);
+                       }, NativeThread.HIGH_PRIORITY);
                } else {
                        callback.onCancelled(container, context);
                }

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to