提交 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 {
/**
* The file data.
*/
final FileMemData data;
FileMemData data;
private final boolean readOnly;
private long pos;
......@@ -369,6 +369,7 @@ class FileMem extends FileBase {
@Override
public void implCloseChannel() throws IOException {
pos = 0;
data = null;
}
@Override
......
......@@ -276,7 +276,7 @@ class FileNioMem extends FileBase {
/**
* The file data.
*/
final FileNioMemData data;
FileNioMemData data;
private final boolean readOnly;
private long pos;
......@@ -364,6 +364,7 @@ class FileNioMem extends FileBase {
@Override
public void implCloseChannel() throws IOException {
pos = 0;
data = null;
}
@Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论