Merge branch 'bufferedfile_fclose' into HEAD

This commit is contained in:
Luke Dashjr 2024-05-15 21:44:51 +00:00
commit b2321063e0
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"); 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 //! check whether we're at the end of the source file
bool eof() const { bool eof() const {
return m_read_pos == nSrcPos && m_src.feof(); return m_read_pos == nSrcPos && m_src.feof();

View File

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