From 2c6ebe28e974265ec889c93b452c95ea5857dd8d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 26 Apr 2019 14:58:09 +0200 Subject: [PATCH] playlist/EmbeddedCue:: wrap CueParser in std::unique_ptr<> --- src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx b/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx index f1efd6d25..77278f243 100644 --- a/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx +++ b/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx @@ -35,6 +35,8 @@ #include "fs/AllocatedPath.hxx" #include "util/ASCII.hxx" +#include + #include class EmbeddedCuePlaylist final : public SongEnumerator { @@ -56,17 +58,9 @@ public: */ char *next; - CueParser *parser; + std::unique_ptr parser; public: - EmbeddedCuePlaylist() noexcept - :parser(nullptr) { - } - - ~EmbeddedCuePlaylist() noexcept override { - delete parser; - } - std::unique_ptr NextSong() override; }; @@ -113,7 +107,7 @@ embcue_playlist_open_uri(const char *uri, playlist->cuesheet = std::move(extract_cuesheet.cuesheet); playlist->next = &playlist->cuesheet[0]; - playlist->parser = new CueParser(); + playlist->parser = std::make_unique(); return playlist; }