aboutsummaryrefslogtreecommitdiffstats
path: root/src/archive
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-05-11 16:59:19 +0200
committerMax Kellermann <max@duempel.org>2014-05-11 17:12:50 +0200
commit82337dec44347017ca04fe975e85e6d9e4edb635 (patch)
tree308036d4a7abbd2bb04ed472dc1fbacdc2587871 /src/archive
parentf1d07002521a4a98acf130127cf42aef20a5e258 (diff)
downloadmpd-82337dec44347017ca04fe975e85e6d9e4edb635.tar.gz
mpd-82337dec44347017ca04fe975e85e6d9e4edb635.tar.xz
mpd-82337dec44347017ca04fe975e85e6d9e4edb635.zip
InputStream: add virtual destructor
Replaces the method Close().
Diffstat (limited to '')
-rw-r--r--src/archive/plugins/Bzip2ArchivePlugin.cxx20
-rw-r--r--src/archive/plugins/Iso9660ArchivePlugin.cxx9
-rw-r--r--src/archive/plugins/ZzipArchivePlugin.cxx9
3 files changed, 2 insertions, 36 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,
diff --git a/src/archive/plugins/Iso9660ArchivePlugin.cxx b/src/archive/plugins/Iso9660ArchivePlugin.cxx
index 8390a354f..0a9cb8214 100644
--- a/src/archive/plugins/Iso9660ArchivePlugin.cxx
+++ b/src/archive/plugins/Iso9660ArchivePlugin.cxx
@@ -181,14 +181,6 @@ Iso9660ArchiveFile::OpenStream(const char *pathname,
statbuf);
}
-static void
-iso9660_input_close(InputStream *is)
-{
- Iso9660InputStream *iis = (Iso9660InputStream *)is;
-
- delete iis;
-}
-
inline size_t
Iso9660InputStream::Read(void *ptr, size_t read_size, Error &error)
{
@@ -250,7 +242,6 @@ const InputPlugin iso9660_input_plugin = {
nullptr,
nullptr,
nullptr,
- iso9660_input_close,
nullptr,
nullptr,
nullptr,
diff --git a/src/archive/plugins/ZzipArchivePlugin.cxx b/src/archive/plugins/ZzipArchivePlugin.cxx
index 69f984e5e..4eafe4aeb 100644
--- a/src/archive/plugins/ZzipArchivePlugin.cxx
+++ b/src/archive/plugins/ZzipArchivePlugin.cxx
@@ -142,14 +142,6 @@ ZzipArchiveFile::OpenStream(const char *pathname,
_file);
}
-static void
-zzip_input_close(InputStream *is)
-{
- ZzipInputStream *zis = (ZzipInputStream *)is;
-
- delete zis;
-}
-
static size_t
zzip_input_read(InputStream *is, void *ptr, size_t size,
Error &error)
@@ -202,7 +194,6 @@ const InputPlugin zzip_input_plugin = {
nullptr,
nullptr,
nullptr,
- zzip_input_close,
nullptr,
nullptr,
nullptr,