diff options
author | Max Kellermann <max@musicpd.org> | 2017-12-22 16:30:17 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-12-22 16:30:17 +0100 |
commit | 9aec2f019aa8742d48a00b27e2e23633ba46fea8 (patch) | |
tree | d8df6add8f2c2426afb28c5a986043db195e710d /src/archive | |
parent | 5da455080bbdff27bf9e8418e2de22107370225f (diff) |
archive/File: eliminate Close(), make destructor virtual instead
Diffstat (limited to 'src/archive')
-rw-r--r-- | src/archive/ArchiveFile.hxx | 9 | ||||
-rw-r--r-- | src/archive/plugins/Bzip2ArchivePlugin.cxx | 4 | ||||
-rw-r--r-- | src/archive/plugins/Iso9660ArchivePlugin.cxx | 4 | ||||
-rw-r--r-- | src/archive/plugins/ZzipArchivePlugin.cxx | 4 |
4 files changed, 1 insertions, 20 deletions
diff --git a/src/archive/ArchiveFile.hxx b/src/archive/ArchiveFile.hxx index 3fa1f796b..72f72d7b9 100644 --- a/src/archive/ArchiveFile.hxx +++ b/src/archive/ArchiveFile.hxx @@ -22,19 +22,12 @@ class Mutex; class Cond; -struct ArchivePlugin; class ArchiveVisitor; class InputStream; class ArchiveFile { -protected: - /** - * Use Close() instead of delete. - */ - ~ArchiveFile() {} - public: - virtual void Close() = 0; + virtual ~ArchiveFile() noexcept = default; /** * Visit all entries inside this archive. diff --git a/src/archive/plugins/Bzip2ArchivePlugin.cxx b/src/archive/plugins/Bzip2ArchivePlugin.cxx index b5f4de055..b8bad8826 100644 --- a/src/archive/plugins/Bzip2ArchivePlugin.cxx +++ b/src/archive/plugins/Bzip2ArchivePlugin.cxx @@ -49,10 +49,6 @@ public: name.erase(len - 4); } - virtual void Close() override { - delete this; - } - virtual void Visit(ArchiveVisitor &visitor) override { visitor.VisitArchiveEntry(name.c_str()); } diff --git a/src/archive/plugins/Iso9660ArchivePlugin.cxx b/src/archive/plugins/Iso9660ArchivePlugin.cxx index beb73eddb..62f61d596 100644 --- a/src/archive/plugins/Iso9660ArchivePlugin.cxx +++ b/src/archive/plugins/Iso9660ArchivePlugin.cxx @@ -72,10 +72,6 @@ public: void Visit(char *path, size_t length, size_t capacity, ArchiveVisitor &visitor); - virtual void Close() override { - delete this; - } - virtual void Visit(ArchiveVisitor &visitor) override; InputStream *OpenStream(const char *path, diff --git a/src/archive/plugins/ZzipArchivePlugin.cxx b/src/archive/plugins/ZzipArchivePlugin.cxx index 2d156c025..e69c7679d 100644 --- a/src/archive/plugins/ZzipArchivePlugin.cxx +++ b/src/archive/plugins/ZzipArchivePlugin.cxx @@ -57,10 +57,6 @@ public: ZzipArchiveFile(std::shared_ptr<ZzipDir> &&_dir) :dir(std::move(_dir)) {} - virtual void Close() override { - delete this; - } - virtual void Visit(ArchiveVisitor &visitor) override; InputStream *OpenStream(const char *path, |