Fix not all pending data getting processed when finishing

master
trivernis 5 years ago
parent 727483de7c
commit ed1123bf25

@ -1,6 +1,6 @@
[package] [package]
name = "bdflib" name = "bdflib"
version = "0.3.1" version = "0.3.2"
authors = ["trivernis <trivernis@gmail.com>"] authors = ["trivernis <trivernis@gmail.com>"]
edition = "2018" edition = "2018"
license-file = "LICENSE" license-file = "LICENSE"

@ -181,6 +181,7 @@ impl BDFWriter {
/// Flushes the buffered chunk data and the writer /// Flushes the buffered chunk data and the writer
/// to finish the file. /// to finish the file.
pub fn finish(&mut self) -> Result<(), Error> { pub fn finish(&mut self) -> Result<(), Error> {
self.flush()?;
self.thread_manager.drop_sender(); self.thread_manager.drop_sender();
self.thread_manager.wait(); self.thread_manager.wait();
self.flush()?; self.flush()?;

Loading…
Cancel
Save