clear mapped buf before unmap

This commit is contained in:
Maxim.Mossienko
2011-07-23 18:09:03 +04:00
parent 03786a3fa8
commit 9903363f55
@@ -50,10 +50,11 @@ public abstract class MappedBufferWrapper {
public final void unmap() {
long started = IOStatistics.DEBUG ? System.currentTimeMillis() : 0;
if (!unmapMappedByteBuffer142b19(this)) {
MappedByteBuffer buffer = getIfCached();
myBuffer = null;
if (!unmapMappedByteBuffer142b19(buffer)) {
LOG.error("Unmapping failed for: " + myFile);
}
myBuffer = null;
if (IOStatistics.DEBUG) {
long finished = System.currentTimeMillis();
@@ -76,8 +77,8 @@ public abstract class MappedBufferWrapper {
}
private static boolean unmapMappedByteBuffer142b19(MappedBufferWrapper holder) {
return clean(holder.getIfCached());
private static boolean unmapMappedByteBuffer142b19(MappedByteBuffer buffer) {
return clean(buffer);
}
private static boolean clean(final MappedByteBuffer buffer) {