From ed1123bf25cb4d9757a026e8fb5cd22ea8535dbc Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 15 Mar 2020 10:57:16 +0100 Subject: [PATCH] Fix not all pending data getting processed when finishing --- Cargo.toml | 2 +- src/io.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e4db50f..fced60b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bdflib" -version = "0.3.1" +version = "0.3.2" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" diff --git a/src/io.rs b/src/io.rs index 3381b5f..1a75d9b 100644 --- a/src/io.rs +++ b/src/io.rs @@ -59,7 +59,7 @@ impl ThreadManager { self.sender_work = None; } - /// Waits for the waitgroup + /// Waits for the wait group pub fn wait(&mut self) { let wg = self.wg.clone(); self.wg = WaitGroup::new(); @@ -181,6 +181,7 @@ impl BDFWriter { /// Flushes the buffered chunk data and the writer /// to finish the file. pub fn finish(&mut self) -> Result<(), Error> { + self.flush()?; self.thread_manager.drop_sender(); self.thread_manager.wait(); self.flush()?;