]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed wxZlibOutputStream::Sync
authorGuilhem Lavaux <lavaux@easynet.fr>
Tue, 31 Aug 1999 18:16:23 +0000 (18:16 +0000)
committerGuilhem Lavaux <lavaux@easynet.fr>
Tue, 31 Aug 1999 18:16:23 +0000 (18:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/zstream.cpp

index 8ccb8710db3fe5e622d065a4742c6609a0fcf3d5..d6e0b5731bc742d3e146fdff245e18f06ab9453a 100644 (file)
@@ -160,6 +160,19 @@ void wxZlibOutputStream::Sync()
     return;
   }
 
     return;
   }
 
+  // Fixed by "Stefan Csomor" <csomor@advancedconcepts.ch>
+  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;
   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;