mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-08-04 05:54:48 +02:00
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:
parent
55bd5d8015
commit
88fe778d9d
@ -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();
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user