diff options
author | Chris Robinson <[email protected]> | 2018-12-27 10:44:02 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-27 10:44:02 -0800 |
commit | 4dca2f2ee5ef488fbe05397de1ab3029e559cf61 (patch) | |
tree | 930224ac816f69b0ca0a7cd0c97e647d6e04da57 /Alc/alu.cpp | |
parent | be85ab6f826a724105cef05e740b5013a1e6149e (diff) |
Use a unique_ptr for the AsyncEvents ringbuffer
Diffstat (limited to 'Alc/alu.cpp')
-rw-r--r-- | Alc/alu.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp index dfbd15a9..672b571b 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -292,11 +292,11 @@ void SendSourceStoppedEvent(ALCcontext *context, ALuint id) ALbitfieldSOFT enabledevt{context->EnabledEvts.load(std::memory_order_acquire)}; if(!(enabledevt&EventType_SourceStateChange)) return; - RingBuffer *ring{context->AsyncEvents}; - auto evt_data = ring->getWriteVector().first; - if(evt_data.len < 1) return; + RingBuffer *ring{context->AsyncEvents.get()}; + auto evt_vec = ring->getWriteVector(); + if(evt_vec.first.len < 1) return; - AsyncEvent *evt{new (evt_data.buf) AsyncEvent{EventType_SourceStateChange}}; + AsyncEvent *evt{new (evt_vec.first.buf) AsyncEvent{EventType_SourceStateChange}}; evt->u.srcstate.id = id; evt->u.srcstate.state = AL_STOPPED; @@ -419,7 +419,7 @@ bool CalcEffectSlotParams(ALeffectslot *slot, ALCcontext *context, bool force) /* Otherwise, if it would be deleted, send it off with a release * event. */ - RingBuffer *ring{context->AsyncEvents}; + RingBuffer *ring{context->AsyncEvents.get()}; auto evt_vec = ring->getWriteVector(); if(LIKELY(evt_vec.first.len > 0)) { @@ -1839,7 +1839,7 @@ void aluHandleDisconnect(ALCdevice *device, const char *msg, ...) const ALbitfieldSOFT enabledevt{ctx->EnabledEvts.load(std::memory_order_acquire)}; if((enabledevt&EventType_Disconnected)) { - RingBuffer *ring{ctx->AsyncEvents}; + RingBuffer *ring{ctx->AsyncEvents.get()}; auto evt_data = ring->getWriteVector().first; if(evt_data.len > 0) { |