Browse Source

Fix DeltaWindow.clear() to release loaded buffer bytes.

It is possible for the buffer to be set but not the index. It
ocurrs when an exception occurs during creating an index, but
after the buffer is loaded. Furthermore, the cleared DeltaWindowEntry
should have been ent and not res.

Change-Id: I2e0d79540316635bf7aa43efd225e4eb38230844
tags/v2.2.0.201212191850-r
Colby Ranger 11 years ago
parent
commit
b9e485661d

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaWindow.java View File

@@ -167,7 +167,7 @@ class DeltaWindow {
private void clear(DeltaWindowEntry ent) {
if (ent.index != null)
loaded -= ent.index.getIndexSize();
else if (res.buffer != null)
else if (ent.buffer != null)
loaded -= ent.buffer.length;
ent.set(null);
}

Loading…
Cancel
Save