summaryrefslogtreecommitdiff
path: root/package/source/zipapi/Inflater.cxx
diff options
context:
space:
mode:
authorMartin Gallwey <mtg@openoffice.org>2000-12-13 16:00:47 +0000
committerMartin Gallwey <mtg@openoffice.org>2000-12-13 16:00:47 +0000
commit4b11504f4ad039fb2311061c7544f00b6ff23c0f (patch)
tree77bd71291871a03a9a5e577114914fc4f5cfbbe0 /package/source/zipapi/Inflater.cxx
parentd6a8a2916c2c00f702b68d427af75d83e2163eb6 (diff)
This rather enormous commit has the following features:
1. Fixed three different memory leaks, one of them quite serious 2. Considerably streamlined the ZipPackageBuffer class - large performance increase, also streamlined EntryInputClass in the same way... 3. Correctly saves embedded zip files as embedded zip files instead of directories 4. Supports the copying of raw streams instead of de-compressing/re- compressing unnecessarily. Marty
Diffstat (limited to 'package/source/zipapi/Inflater.cxx')
-rw-r--r--package/source/zipapi/Inflater.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/package/source/zipapi/Inflater.cxx b/package/source/zipapi/Inflater.cxx
index 5e4eba639f74..934cabb0862d 100644
--- a/package/source/zipapi/Inflater.cxx
+++ b/package/source/zipapi/Inflater.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: Inflater.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: mtg $ $Date: 2000-11-21 12:07:21 $
+ * last change: $Author: mtg $ $Date: 2000-12-13 17:00:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -116,8 +116,7 @@ Inflater::Inflater()
}
Inflater::~Inflater()
{
- if (pStream)
- delete pStream;
+ end();
}
void SAL_CALL Inflater::setInputSegment( const com::sun::star::uno::Sequence< sal_Int8 >& rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength )
throw(com::sun::star::uno::RuntimeException)
@@ -231,7 +230,11 @@ void SAL_CALL Inflater::reset( )
void SAL_CALL Inflater::end( )
throw(com::sun::star::uno::RuntimeException)
{
- z_inflateEnd(pStream);
+ if (pStream != NULL)
+ {
+ z_inflateEnd(pStream);
+ delete pStream;
+ }
pStream = NULL;
}