aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-03-22 18:48:33 -0700
committerChris Robinson <[email protected]>2020-03-22 18:48:33 -0700
commit813d4ed5668b44532f234a860ef494411a1009b1 (patch)
tree32d7c53cfb911128e29ca8444a8bca54607fed9f
parent49b2d703e771a9d5a4cebf13ab017f7c06251c9b (diff)
Use make_unique instead of new'ing into a unique_ptr
-rw-r--r--alc/alc.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp
index 1608cac6..562005fd 100644
--- a/alc/alc.cpp
+++ b/alc/alc.cpp
@@ -1644,7 +1644,7 @@ void ALCcontext::allocVoiceChanges(size_t addcount)
addcount = (addcount+(clustersize-1)) / clustersize;
while(addcount)
{
- VoiceChangeCluster cluster{new VoiceChange[clustersize]};
+ VoiceChangeCluster cluster{std::make_unique<VoiceChange[]>(clustersize)};
for(size_t i{1};i < clustersize;++i)
cluster[i-1].mNext.store(std::addressof(cluster[i]), std::memory_order_relaxed);
cluster[clustersize-1].mNext.store(mVoiceChangeTail, std::memory_order_relaxed);
@@ -1666,7 +1666,7 @@ void ALCcontext::allocVoices(size_t addcount)
auto newarray = ALvoiceArray::Create((mVoiceClusters.size()+addcount) * clustersize);
while(addcount)
{
- mVoiceClusters.emplace_back(VoiceCluster{new ALvoice[clustersize]});
+ mVoiceClusters.emplace_back(std::make_unique<ALvoice[]>(clustersize));
--addcount;
}