Skip to content

Commit 61ff8ea

Browse files
committed
AbstractHigherOrderDataHandle: null wrapped handle on close.
1 parent b65ff9a commit 61ff8ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/scijava/io/handle/AbstractHigherOrderHandle.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public abstract class AbstractHigherOrderHandle<L extends Location> extends
4646
AbstractDataHandle<L>
4747
{
4848

49-
private final DataHandle<L> handle;
49+
private DataHandle<L> handle;
5050
private boolean closed;
5151

5252
public AbstractHigherOrderHandle(final DataHandle<L> handle) {
@@ -66,6 +66,7 @@ public boolean isWritable() {
6666

6767
@Override
6868
public long length() throws IOException {
69+
ensureOpen();
6970
return handle.length();
7071
}
7172

@@ -85,6 +86,7 @@ public void close() throws IOException {
8586
cleanup();
8687
closed = true;
8788
handle.close();
89+
handle = null;
8890
}
8991
}
9092

0 commit comments

Comments
 (0)