diff options
Diffstat (limited to '')
-rw-r--r-- | src/input/DespotifyInputPlugin.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/input/DespotifyInputPlugin.cxx b/src/input/DespotifyInputPlugin.cxx index 787e0722e..18704bd40 100644 --- a/src/input/DespotifyInputPlugin.cxx +++ b/src/input/DespotifyInputPlugin.cxx @@ -41,7 +41,7 @@ class DespotifyInputStream { struct despotify_session *session; struct ds_track *track; - Tag *tag; + Tag tag; struct ds_pcm_data pcm; size_t len_available; bool eof; @@ -64,8 +64,6 @@ class DespotifyInputStream { public: ~DespotifyInputStream() { - delete tag; - despotify_free_track(track); } @@ -79,8 +77,11 @@ public: size_t Read(void *ptr, size_t size, Error &error); Tag *ReadTag() { - Tag *result = tag; - tag = nullptr; + if (tag.IsEmpty()) + return nullptr; + + Tag *result = new Tag(std::move(tag)); + tag.Clear(); return result; } |