diff options
author | Chris Robinson <[email protected]> | 2021-06-21 03:54:49 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-06-21 03:54:49 -0700 |
commit | 1c5a6ad92bf0c6d94bf2251000bc73f040841c26 (patch) | |
tree | 452a91fa7a68c6195fb58e7f5da3cd236dc6d505 | |
parent | 5b1d9030a1aee48514119e5ad4dea1974ea35b73 (diff) |
Use a unique_ptr to hold raw byte memory
-rw-r--r-- | alc/backends/coreaudio.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp index bdc3ed60..b616092d 100644 --- a/alc/backends/coreaudio.cpp +++ b/alc/backends/coreaudio.cpp @@ -30,6 +30,8 @@ #include <unistd.h> #include <cmath> +#include <memory> +#include <string> #include "alnumeric.h" #include "core/converter.h" @@ -140,8 +142,8 @@ UInt32 GetDeviceChannelCount(AudioDeviceID devId, bool isCapture) return 0; } - auto buffer_data = std::vector<char>(propSize); - AudioBufferList *buflist{reinterpret_cast<AudioBufferList*>(buffer_data.data())}; + auto buflist_data = std::make_unique<char[]>(propSize); + auto *buflist = reinterpret_cast<AudioBufferList*>(buflist_data.get()); err = GetDevProperty(devId, kAudioDevicePropertyStreamConfiguration, isCapture, 0, propSize, buflist); |