From 6acdb1f632bdcbc1332caecb9d5ecd3d0eff36ad Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Wed, 24 Apr 2024 16:11:31 +1200 Subject: Flush file contents each frame and when closing the file --- src/emulator.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/emulator.rs') diff --git a/src/emulator.rs b/src/emulator.rs index e88e320..125cf03 100644 --- a/src/emulator.rs +++ b/src/emulator.rs @@ -4,7 +4,6 @@ use bedrock_core::*; use phosphor::*; use std::cmp::{min, max}; -use std::io::Write; use std::time::*; use std::thread::sleep; @@ -220,12 +219,15 @@ impl WindowController for BedrockEmulator { break; }, Signal::Halt => { - self.vm.dev.stream.stdout.flush().unwrap(); + self.vm.dev.stream.flush_local(); + self.vm.dev.file.flush_entry(); exit(0); }, } } } + self.vm.dev.stream.flush_local(); + self.vm.dev.file.flush_entry(); self.process_mark = Instant::now(); } -- cgit v1.2.3-70-g09d2