Author: toad
Date: 2009-03-07 00:03:23 +0000 (Sat, 07 Mar 2009)
New Revision: 25922

Modified:
   branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java
Log:
Fix leak of SingleBlockInserter's (insert a small file with metadata to 
duplicate the bug with the old code)


Modified: 
branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java     
2009-03-07 00:02:33 UTC (rev 25921)
+++ branches/db4o/freenet/src/freenet/client/async/SingleBlockInserter.java     
2009-03-07 00:03:23 UTC (rev 25922)
@@ -270,6 +270,7 @@
                        parent.failedBlock(container, context);
                if(persistent)
                        container.activate(cb, 1);
+               unregister(container, context);
                cb.onFailure(e, this, container, context);
                if(freeData) {
                        sourceData.free();
@@ -390,6 +391,7 @@
                }
                parent.completedBlock(false, container, context);
                if(logMINOR) Logger.minor(this, "Calling onSuccess for "+cb);
+               unregister(container, context);
                cb.onSuccess(this, container, context);
                if(persistent)
                        container.deactivate(cb, 1);
@@ -664,6 +666,7 @@
        }
 
        public void removeFrom(ObjectContainer container, ClientContext 
context) {
+               if(logMINOR) Logger.minor(this, "removeFrom() on "+this);
                // FIXME remove sourceData ???
                container.activate(uri, 5);
                if(uri != FreenetURI.EMPTY_CHK_URI)
@@ -682,4 +685,15 @@
                }
                container.delete(this);
        }
+       
+//     public boolean objectCanNew(ObjectContainer container) {
+//             Logger.minor(this, "objectCanNew() on "+this, new 
Exception("debug"));
+//             return true;
+//     }
+//     
+//     public boolean objectCanUpdate(ObjectContainer container) {
+//             Logger.minor(this, "objectCanUpdate() on "+this, new 
Exception("debug"));
+//             return true;
+//     }
+//     
 }

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

Reply via email to