[ 1070686 ] wxOutputStream::Close()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ryan Norton
2004-11-23 14:26:10 +00:00
parent 95662a8379
commit 8f0ff17851
9 changed files with 45 additions and 16 deletions

View File

@@ -238,20 +238,20 @@ wxZlibOutputStream::wxZlibOutputStream(wxOutputStream& stream,
m_lasterror = wxSTREAM_WRITE_ERROR;
}
wxZlibOutputStream::~wxZlibOutputStream()
{
if (m_deflate && m_z_buffer)
DoFlush(true);
deflateEnd(m_deflate);
delete m_deflate;
bool wxZlibOutputStream::Close()
{
DoFlush(true);
deflateEnd(m_deflate);
delete m_deflate;
delete[] m_z_buffer;
}
m_deflate = NULL;
delete[] m_z_buffer;
m_z_buffer = NULL;
return IsOk();
}
void wxZlibOutputStream::DoFlush(bool final)
{
wxASSERT_MSG(m_deflate && m_z_buffer, wxT("Deflate stream not open"));
if (!m_deflate || !m_z_buffer)
m_lasterror = wxSTREAM_WRITE_ERROR;
if (!IsOk())