提交 90f3688c authored 作者: Noel Grandin's avatar Noel Grandin

clear data reference in implCloseChannel

so we catch anything trying to touch this data after the FileChannel is closed
上级 2d9a3510
...@@ -267,7 +267,7 @@ class FileMem extends FileBase { ...@@ -267,7 +267,7 @@ class FileMem extends FileBase {
/** /**
* The file data. * The file data.
*/ */
final FileMemData data; FileMemData data;
private final boolean readOnly; private final boolean readOnly;
private long pos; private long pos;
...@@ -369,6 +369,7 @@ class FileMem extends FileBase { ...@@ -369,6 +369,7 @@ class FileMem extends FileBase {
@Override @Override
public void implCloseChannel() throws IOException { public void implCloseChannel() throws IOException {
pos = 0; pos = 0;
data = null;
} }
@Override @Override
......
...@@ -276,7 +276,7 @@ class FileNioMem extends FileBase { ...@@ -276,7 +276,7 @@ class FileNioMem extends FileBase {
/** /**
* The file data. * The file data.
*/ */
final FileNioMemData data; FileNioMemData data;
private final boolean readOnly; private final boolean readOnly;
private long pos; private long pos;
...@@ -364,6 +364,7 @@ class FileNioMem extends FileBase { ...@@ -364,6 +364,7 @@ class FileNioMem extends FileBase {
@Override @Override
public void implCloseChannel() throws IOException { public void implCloseChannel() throws IOException {
pos = 0; pos = 0;
data = null;
} }
@Override @Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论