[FS] Better file flushing
Fixes a small memory leak and some filesystem bugs
This commit is contained in:
@@ -92,6 +92,12 @@ bool IOFile::seek(std::int64_t offset, int origin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IOFile::flush() {
|
||||
if (!isOpen() || fflush(handle)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IOFile::rewind() { return seek(0, SEEK_SET); }
|
||||
FILE* IOFile::getHandle() { return handle; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user