aboutsummaryrefslogtreecommitdiffstats
path: root/src/archive/plugins/Bzip2ArchivePlugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/archive/plugins/Bzip2ArchivePlugin.cxx')
-rw-r--r--src/archive/plugins/Bzip2ArchivePlugin.cxx20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/archive/plugins/Bzip2ArchivePlugin.cxx b/src/archive/plugins/Bzip2ArchivePlugin.cxx
index 6940f1380..213b7d38c 100644
--- a/src/archive/plugins/Bzip2ArchivePlugin.cxx
+++ b/src/archive/plugins/Bzip2ArchivePlugin.cxx
@@ -61,7 +61,7 @@ public:
}
~Bzip2ArchiveFile() {
- istream->Close();
+ delete istream;
}
void Ref() {
@@ -102,7 +102,6 @@ struct Bzip2InputStream final : public InputStream {
~Bzip2InputStream();
bool Open(Error &error);
- void Close();
};
extern const InputPlugin bz2_inputplugin;
@@ -132,12 +131,6 @@ Bzip2InputStream::Open(Error &error)
return true;
}
-inline void
-Bzip2InputStream::Close()
-{
- BZ2_bzDecompressEnd(&bzstream);
-}
-
/* archive open && listing routine */
static ArchiveFile *
@@ -166,6 +159,7 @@ Bzip2InputStream::Bzip2InputStream(Bzip2ArchiveFile &_context,
Bzip2InputStream::~Bzip2InputStream()
{
+ BZ2_bzDecompressEnd(&bzstream);
archive->Unref();
}
@@ -183,15 +177,6 @@ Bzip2ArchiveFile::OpenStream(const char *path,
return bis;
}
-static void
-bz2_is_close(InputStream *is)
-{
- Bzip2InputStream *bis = (Bzip2InputStream *)is;
-
- bis->Close();
- delete bis;
-}
-
static bool
bz2_fillbuffer(Bzip2InputStream *bis, Error &error)
{
@@ -273,7 +258,6 @@ const InputPlugin bz2_inputplugin = {
nullptr,
nullptr,
nullptr,
- bz2_is_close,
nullptr,
nullptr,
nullptr,