X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/45805ba32255e4115b2ddddc15a5db5720ecb7ba..39d16996b7616bf8090b140db74fd0b52d50d169:/src/common/zstream.cpp diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp index 29a7dfa23b..4c7a7bf0ec 100644 --- a/src/common/zstream.cpp +++ b/src/common/zstream.cpp @@ -33,10 +33,8 @@ // the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here #if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH) #include "../zlib/zlib.h" -#elif defined(__WXMAC__) && defined(__UNIX__) - #include #else - #include + #include "zlib.h" #endif #define ZSTREAM_BUFFER_SIZE 1024 @@ -128,8 +126,14 @@ wxZlibOutputStream::wxZlibOutputStream(wxOutputStream& stream, int level) m_deflate->zfree = (free_func)0; m_deflate->opaque = (voidpf)0; - if (level == -1) level = Z_DEFAULT_COMPRESSION; - wxASSERT_MSG(level >= 0 && level <= 9, wxT("wxZlibOutputStream compression level must be between 0 and 9!")); + if ( level == -1 ) + { + level = Z_DEFAULT_COMPRESSION; + } + else + { + wxASSERT_MSG(level >= 0 && level <= 9, wxT("wxZlibOutputStream compression level must be between 0 and 9!")); + } err = deflateInit(m_deflate, level); if (err != Z_OK) { @@ -159,6 +163,7 @@ wxZlibOutputStream::~wxZlibOutputStream() } deflateEnd(m_deflate); + delete m_deflate; delete[] m_z_buffer; }