throw new Error("Failed to create advisory lock file "+_lock);
}
}
- return advisory.isLocked();
+ return (advisory!=null) && advisory.isLocked();
}
/**
* call to clear up a filelock file after its been made
private void tidy() {
if (_lock!=null) {
if ( advisory!=null) {
+ advisory.target.deleteOnExit(); // release will null the target
advisory.release(true);
- advisory.target.deleteOnExit();
}
advisory=null;
_lock=null;