git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@334
be28352e-c001-0410-b1a7-
c7978e42abec
public void release(boolean closeChannel) {
if (!isLocked())
return;
- if (log.isDebugEnabled())
- log.debug("Releasing advisory lock on "+target);
- if (closeChannel) {
- if (rafile!=null)
+ if (rafile!=null) {
+ if (closeChannel) {
try {
rafile.close();
} catch (Exception e) {
log.debug("Unexpected exception whilst closing RandomAccessFile on "+target, e);
}
- rafile=null;
+ rafile=null; // do not hold reference to rafile anymore either
+ }
+ if (log.isDebugEnabled())
+ log.debug("Releasing advisory lock on "+target);
+ // TODO: LATER: verify this change in closeChannel semantics really is correct - ArchiveClient works correctly
}
tidy();
}