diff options
author | Max Kellermann <max@duempel.org> | 2014-05-11 16:59:19 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-05-11 17:12:50 +0200 |
commit | 82337dec44347017ca04fe975e85e6d9e4edb635 (patch) | |
tree | 308036d4a7abbd2bb04ed472dc1fbacdc2587871 /src/input/plugins/DespotifyInputPlugin.cxx | |
parent | f1d07002521a4a98acf130127cf42aef20a5e258 (diff) | |
download | mpd-82337dec44347017ca04fe975e85e6d9e4edb635.tar.gz mpd-82337dec44347017ca04fe975e85e6d9e4edb635.tar.xz mpd-82337dec44347017ca04fe975e85e6d9e4edb635.zip |
InputStream: add virtual destructor
Replaces the method Close().
Diffstat (limited to 'src/input/plugins/DespotifyInputPlugin.cxx')
-rw-r--r-- | src/input/plugins/DespotifyInputPlugin.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/input/plugins/DespotifyInputPlugin.cxx b/src/input/plugins/DespotifyInputPlugin.cxx index 16ef07f0d..86fbbbad3 100644 --- a/src/input/plugins/DespotifyInputPlugin.cxx +++ b/src/input/plugins/DespotifyInputPlugin.cxx @@ -61,9 +61,7 @@ class DespotifyInputStream final : public InputStream { } public: - ~DespotifyInputStream() { - despotify_free_track(track); - } + ~DespotifyInputStream(); static InputStream *Open(const char *url, Mutex &mutex, Cond &cond, Error &error); @@ -146,6 +144,12 @@ static void callback(gcc_unused struct despotify_session* ds, ctx->Callback(sig); } +DespotifyInputStream::~DespotifyInputStream() +{ + mpd_despotify_unregister_callback(callback); + despotify_free_track(track); +} + inline InputStream * DespotifyInputStream::Open(const char *url, Mutex &mutex, Cond &cond, @@ -220,15 +224,6 @@ input_despotify_read(InputStream *is, void *ptr, size_t size, Error &error) return ctx->Read(ptr, size, error); } -static void -input_despotify_close(InputStream *is) -{ - DespotifyInputStream *ctx = (DespotifyInputStream *)is; - - mpd_despotify_unregister_callback(callback); - delete ctx; -} - static bool input_despotify_eof(InputStream *is) { @@ -250,7 +245,6 @@ const InputPlugin input_plugin_despotify = { nullptr, nullptr, input_despotify_open, - input_despotify_close, nullptr, nullptr, input_despotify_tag, |