Author: toad
Date: 2009-03-12 19:01:58 +0000 (Thu, 12 Mar 2009)
New Revision: 26007
Modified:
branches/db4o/freenet/src/freenet/support/io/SegmentedBucketChainBucket.java
Log:
Fix leak, paranoia
Modified:
branches/db4o/freenet/src/freenet/support/io/SegmentedBucketChainBucket.java
===================================================================
---
branches/db4o/freenet/src/freenet/support/io/SegmentedBucketChainBucket.java
2009-03-12 19:00:25 UTC (rev 26006)
+++
branches/db4o/freenet/src/freenet/support/io/SegmentedBucketChainBucket.java
2009-03-12 19:01:58 UTC (rev 26007)
@@ -70,6 +70,11 @@
public void run(ObjectContainer container,
ClientContext context) {
SegmentedChainBucketSegment segment = null;
+
if(container.ext().isStored(SegmentedBucketChainBucket.this)) {
+ Logger.error(this, "Bucket not stored
in freeJob, already deleted???");
+ container.delete(this);
+ return;
+ }
synchronized(this) {
if(!segments.isEmpty())
segment = segments.remove(0);
@@ -92,6 +97,7 @@
}
container.delete(segments);
container.delete(SegmentedBucketChainBucket.this);
+ container.delete(this);
synchronized(SegmentedBucketChainBucket.this) {
if(killMe == null) return;
}
@@ -446,6 +452,11 @@
DBJob clearJob = new DBJob() {
public void run(ObjectContainer container,
ClientContext context) {
+
if(container.ext().isStored(SegmentedBucketChainBucket.this)) {
+ Logger.error(this, "Bucket not stored
in clearJob, already deleted???");
+ container.delete(this);
+ return;
+ }
SegmentedChainBucketSegment segment = null;
synchronized(this) {
if(!segments.isEmpty())
@@ -468,6 +479,7 @@
}
container.delete(segments);
container.delete(SegmentedBucketChainBucket.this);
+ container.delete(this);
synchronized(SegmentedBucketChainBucket.this) {
if(killMe == null) return;
}
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs