diff options
Diffstat (limited to 'al/auxeffectslot.cpp')
-rw-r--r-- | al/auxeffectslot.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index efc75aac..dbd16928 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -117,9 +117,8 @@ void AddActiveEffectSlots(const ALuint *slotids, size_t count, ALCcontext *conte std::uninitialized_fill_n(newarray->end(), newcount, nullptr); curarray = context->mActiveAuxSlots.exchange(newarray, std::memory_order_acq_rel); - ALCdevice *device{context->mDevice.get()}; - while((device->MixCount.load(std::memory_order_acquire)&1)) - std::this_thread::yield(); + context->mDevice->waitForMix(); + al::destroy_n(curarray->end(), curarray->size()); delete curarray; } @@ -155,9 +154,8 @@ void RemoveActiveEffectSlots(const ALuint *slotids, size_t count, ALCcontext *co std::uninitialized_fill_n(newarray->end(), newsize, nullptr); curarray = context->mActiveAuxSlots.exchange(newarray, std::memory_order_acq_rel); - ALCdevice *device{context->mDevice.get()}; - while((device->MixCount.load(std::memory_order_acquire)&1)) - std::this_thread::yield(); + context->mDevice->waitForMix(); + al::destroy_n(curarray->end(), curarray->size()); delete curarray; } |