projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added debug/release DLL configurations so that VC++ chooses the right one when buildi...
[wxWidgets.git]
/
src
/
common
/
zipstrm.cpp
diff --git
a/src/common/zipstrm.cpp
b/src/common/zipstrm.cpp
index 0242e357996ba559a04d7c85df1a306ff631ed35..63b941e3a4d9a19c78960d5ae1aafa50a3e67117 100644
(file)
--- a/
src/common/zipstrm.cpp
+++ b/
src/common/zipstrm.cpp
@@
-470,7
+470,6
@@
class wxZipMemory
{
public:
wxZipMemory() : m_data(NULL), m_size(0), m_capacity(0), m_ref(1) { }
{
public:
wxZipMemory() : m_data(NULL), m_size(0), m_capacity(0), m_ref(1) { }
- ~wxZipMemory() { delete m_data; }
wxZipMemory *AddRef() { m_ref++; return this; }
void Release() { if (--m_ref == 0) delete this; }
wxZipMemory *AddRef() { m_ref++; return this; }
void Release() { if (--m_ref == 0) delete this; }
@@
-482,6
+481,7
@@
public:
wxZipMemory *Unique(size_t size);
private:
wxZipMemory *Unique(size_t size);
private:
+ ~wxZipMemory() { delete m_data; }
char *m_data;
size_t m_size;
char *m_data;
size_t m_size;
@@
-548,7
+548,6
@@
class wxZipWeakLinks
{
public:
wxZipWeakLinks() : m_ref(1) { }
{
public:
wxZipWeakLinks() : m_ref(1) { }
- ~wxZipWeakLinks() { wxASSERT(IsEmpty()); }
void Release(const wxZipInputStream* WXUNUSED(x))
{ if (--m_ref == 0) delete this; }
void Release(const wxZipInputStream* WXUNUSED(x))
{ if (--m_ref == 0) delete this; }
@@
-562,6
+561,7
@@
public:
bool IsEmpty() const { return m_entries.empty(); }
private:
bool IsEmpty() const { return m_entries.empty(); }
private:
+ ~wxZipWeakLinks() { wxASSERT(IsEmpty()); }
int m_ref;
_wxOffsetZipEntryMap m_entries;
int m_ref;
_wxOffsetZipEntryMap m_entries;
@@
-1147,7
+1147,6
@@
class wxZipStreamLink
{
public:
wxZipStreamLink(wxZipOutputStream *stream) : m_ref(1), m_stream(stream) { }
{
public:
wxZipStreamLink(wxZipOutputStream *stream) : m_ref(1), m_stream(stream) { }
- ~wxZipStreamLink() { }
wxZipStreamLink *AddRef() { m_ref++; return this; }
wxZipOutputStream *GetOutputStream() const { return m_stream; }
wxZipStreamLink *AddRef() { m_ref++; return this; }
wxZipOutputStream *GetOutputStream() const { return m_stream; }
@@
-1158,6
+1157,7
@@
public:
{ m_stream = NULL; if (--m_ref == 0) delete this; }
private:
{ m_stream = NULL; if (--m_ref == 0) delete this; }
private:
+ ~wxZipStreamLink() { }
int m_ref;
wxZipOutputStream *m_stream;
int m_ref;
wxZipOutputStream *m_stream;
@@
-1351,6
+1351,9
@@
bool wxZipInputStream::LoadEndRecord()
//
bool wxZipInputStream::FindEndRecord()
{
//
bool wxZipInputStream::FindEndRecord()
{
+ if (!m_parent_i_stream->IsSeekable())
+ return false;
+
// usually it's 22 bytes in size and the last thing in the file
{
wxLogNull nolog;
// usually it's 22 bytes in size and the last thing in the file
{
wxLogNull nolog;
@@
-1917,7
+1920,7
@@
bool wxZipOutputStream::DoCreate(wxZipEntry *entry, bool raw /*=false*/)
ds << LOCAL_MAGIC;
// and if this is the first entry test for seekability
ds << LOCAL_MAGIC;
// and if this is the first entry test for seekability
- if (m_headerOffset == 0) {
+ if (m_headerOffset == 0
&& m_parent_o_stream->IsSeekable()
) {
bool logging = wxLog::IsEnabled();
wxLogNull nolog;
wxFileOffset here = m_parent_o_stream->TellO();
bool logging = wxLog::IsEnabled();
wxLogNull nolog;
wxFileOffset here = m_parent_o_stream->TellO();