MusicChunkPtr: managed MusicChunk pointer

Make all uses of MusicChunk safe.
This commit is contained in:
Max Kellermann
2017-12-30 18:00:40 +01:00
parent e81b089612
commit 54d295c247
14 changed files with 120 additions and 60 deletions

View File

@@ -20,11 +20,10 @@
#ifndef MPD_MUSIC_BUFFER_HXX
#define MPD_MUSIC_BUFFER_HXX
#include "MusicChunkPtr.hxx"
#include "util/SliceBuffer.hxx"
#include "thread/Mutex.hxx"
struct MusicChunk;
/**
* An allocator for #MusicChunk objects.
*/
@@ -71,7 +70,7 @@ public:
* @return an empty chunk or nullptr if there are no chunks
* available
*/
MusicChunk *Allocate() noexcept;
MusicChunkPtr Allocate() noexcept;
/**
* Returns a chunk to the buffer. It can be reused by