summaryrefslogtreecommitdiff
path: root/src/MusicChunk.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-20 14:43:29 +0100
committerMax Kellermann <max@musicpd.org>2017-12-20 15:02:14 +0100
commit25fa3ccade6aa9ab0d03c58ffbe8fee4945a3a3c (patch)
tree38e1c77cf073a21e6ea7ef4f077b185635461c61 /src/MusicChunk.hxx
parentc6a95395b57e6925d683339c969fa43d2f6b48e3 (diff)
MusicChunk, player/Thread: use std::unique_ptr<Tag>
Diffstat (limited to 'src/MusicChunk.hxx')
-rw-r--r--src/MusicChunk.hxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/MusicChunk.hxx b/src/MusicChunk.hxx
index a730a0b2d..394366308 100644
--- a/src/MusicChunk.hxx
+++ b/src/MusicChunk.hxx
@@ -28,6 +28,8 @@
#include "AudioFormat.hxx"
#endif
+#include <memory>
+
#include <stdint.h>
#include <stddef.h>
@@ -67,11 +69,9 @@ struct MusicChunk {
/**
* An optional tag associated with this chunk (and the
- * following chunks); appears at song boundaries. The tag
- * object is owned by this chunk, and must be freed when this
- * chunk is deinitialized.
+ * following chunks); appears at song boundaries.
*/
- Tag *tag = nullptr;
+ std::unique_ptr<Tag> tag;
/**
* Replay gain information associated with this chunk.
@@ -101,12 +101,10 @@ struct MusicChunk {
AudioFormat audio_format;
#endif
- MusicChunk() = default;
+ MusicChunk() noexcept;
+ ~MusicChunk() noexcept;
MusicChunk(const MusicChunk &) = delete;
-
- ~MusicChunk();
-
MusicChunk &operator=(const MusicChunk &) = delete;
bool IsEmpty() const {