From 82337dec44347017ca04fe975e85e6d9e4edb635 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 11 May 2014 16:59:19 +0200 Subject: InputStream: add virtual destructor Replaces the method Close(). --- src/archive/plugins/Bzip2ArchivePlugin.cxx | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'src/archive/plugins/Bzip2ArchivePlugin.cxx') 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, -- cgit v1.2.3