orbiter 14 years ago
parent 24e4126eee
commit 733903f2c9

@ -59,7 +59,7 @@ public final class BufferedRecords {
*/
public synchronized void flushBuffer() throws IOException {
this.flushBuffer0();
efs.flushBuffer();
if (efs != null) efs.flushBuffer();
}
private final void flushBuffer0() throws IOException {

@ -178,6 +178,7 @@ public final class Records {
* write buffer to end of file
*/
protected final synchronized void flushBuffer() {
if (raf == null) return;
try {
raf.seek(raf.length());
raf.write(this.buffer, 0, this.recordsize * this.buffercount);
@ -188,10 +189,9 @@ public final class Records {
}
public final synchronized void close() {
flushBuffer();
// then close the file
// close the file
if (raf != null) try {
flushBuffer();
raf.close();
} catch (final IOException e) {
Log.logException(e);

@ -430,7 +430,7 @@ public class Table implements Index, Iterable<Row.Entry> {
}
public void close() {
this.file.close();
if (this.file != null) this.file.close();
this.file = null;
if (this.table != null) this.table.close();
this.table = null;
@ -778,7 +778,8 @@ public class Table implements Index, Iterable<Row.Entry> {
public synchronized void clear() throws IOException {
final File f = file.filename();
file.close();
this.file.close();
this.file = null;
FileUtils.deletedelete(f);
// make new file

Loading…
Cancel
Save