BufferedFile: fclose at destruction

This is currently indirectly implied by src/bench/load_external.cpp:LoadExternalBlockFile
	"The file will be closed by LoadExternalBlockFile()."
This commit is contained in:
Luke Dashjr 2024-03-10 17:54:26 +00:00
parent 55bd5d8015
commit 88fe778d9d
2 changed files with 8 additions and 0 deletions

View file

@ -520,6 +520,10 @@ public:
throw std::ios_base::failure("Rewind limit must be less than buffer size");
}
~BufferedFile() { fclose(); }
int fclose() { return m_src.fclose(); }
//! check whether we're at the end of the source file
bool eof() const {
return m_read_pos == nSrcPos && m_src.feof();

View file

@ -65,4 +65,8 @@ FUZZ_TARGET(buffered_file)
}
opt_buffered_file->GetPos();
}
if (opt_buffered_file) {
opt_buffered_file->fclose();
opt_buffered_file.reset();
}
}