git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@355
be28352e-c001-0410-b1a7-
c7978e42abec
*/
private void tidy() {
if (_lock!=null) {
*/
private void tidy() {
if (_lock!=null) {
- advisory.target.deleteOnExit();
+ advisory.target.deleteOnExit();
+ }
advisory=null;
_lock=null;
}
advisory=null;
_lock=null;
}
}
public void release(boolean closeChannel) {
}
public void release(boolean closeChannel) {
+ if (lock==null)
+ return;
try {
// channel.close should be called before release() for rigourous locking.
try {
// channel.close should be called before release() for rigourous locking.
- if (rafile!=null && rafile.getFD().valid() && rafile.getChannel()!=null && lock.isValid()) {
+ if (lock.isValid() && rafile!=null && rafile.getFD().valid() && rafile.getChannel()!=null) {
if (closeChannel && rafile.getChannel().isOpen()) {
rafile.close();
rafile=null;
if (closeChannel && rafile.getChannel().isOpen()) {
rafile.close();
rafile=null;