diff src/org/tmatesoft/hg/repo/HgRepositoryLock.java @ 619:868b2ffdcd5c

Close FIS, not FileChannel, to clear both references to FileDescriptor right away
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 17 May 2013 22:04:23 +0200
parents f41dd9a3b8af
children 5afc7eedb3dd
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgRepositoryLock.java	Thu May 16 19:46:13 2013 +0200
+++ b/src/org/tmatesoft/hg/repo/HgRepositoryLock.java	Fri May 17 22:04:23 2013 +0200
@@ -191,10 +191,11 @@
 	}
 
 	private static byte[] read(File f) throws IOException {
-		FileChannel fc = new FileInputStream(f).getChannel();
+		FileInputStream fis = new FileInputStream(f);
+		FileChannel fc = fis.getChannel();
 		ByteBuffer bb = ByteBuffer.allocate(Internals.ltoi(fc.size()));
 		fc.read(bb);
-		fc.close();
+		fis.close();
 		return bb.array();
 	}
 }