From babd4308f2704f4234e271d29a8e8c1e211b4af6 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 31 Aug 1999 18:16:23 +0000 Subject: [PATCH] Fixed wxZlibOutputStream::Sync git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/zstream.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp index 8ccb8710db..d6e0b5731b 100644 --- a/src/common/zstream.cpp +++ b/src/common/zstream.cpp @@ -160,6 +160,19 @@ void wxZlibOutputStream::Sync() return; } + // Fixed by "Stefan Csomor" + while( m_deflate->avail_out == 0 ) + { + m_parent_o_stream->Write(m_z_buffer, m_z_size ); + m_deflate->next_out = m_z_buffer; + m_deflate->avail_out = m_z_size; + err = deflate(m_deflate, Z_FULL_FLUSH); + if (err != Z_OK) { + return; + } + } + // End + m_parent_o_stream->Write(m_z_buffer, m_z_size-m_deflate->avail_out); m_deflate->next_out = m_z_buffer; m_deflate->avail_out = m_z_size;