It looks like there's file opening and closing in `Flush()`, which could throw, so shouldn't be called in a destructor