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 /OpenAL32 | |
parent | be85ab6f826a724105cef05e740b5013a1e6149e (diff) |
Use a unique_ptr for the AsyncEvents ringbuffer
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/alSource.cpp | 2 | ||||
-rw-r--r-- | OpenAL32/event.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp index ac2979a5..98c79213 100644 --- a/OpenAL32/alSource.cpp +++ b/OpenAL32/alSource.cpp @@ -697,7 +697,7 @@ void SendStateChangeEvent(ALCcontext *context, ALuint id, ALenum state) * and we don't want state change messages to occur out of order, so send * it through the async queue to ensure proper ordering. */ - RingBuffer *ring{context->AsyncEvents}; + RingBuffer *ring{context->AsyncEvents.get()}; auto evt_vec = ring->getWriteVector(); if(evt_vec.first.len < 1) return; diff --git a/OpenAL32/event.cpp b/OpenAL32/event.cpp index f14c3229..f3474139 100644 --- a/OpenAL32/event.cpp +++ b/OpenAL32/event.cpp @@ -17,7 +17,7 @@ static int EventThread(ALCcontext *context) { - RingBuffer *ring{context->AsyncEvents}; + RingBuffer *ring{context->AsyncEvents.get()}; bool quitnow{false}; while(LIKELY(!quitnow)) { @@ -44,7 +44,7 @@ static int EventThread(ALCcontext *context) evt.~AsyncEvent(); ring->readAdvance(1); } - } _{evt, context->AsyncEvents}; + } _{evt, context->AsyncEvents.get()}; quitnow = evt.EnumType == EventType_KillThread; if(UNLIKELY(quitnow)) break; @@ -111,7 +111,7 @@ void StartEventThrd(ALCcontext *ctx) void StopEventThrd(ALCcontext *ctx) { static constexpr AsyncEvent kill_evt{EventType_KillThread}; - RingBuffer *ring{ctx->AsyncEvents}; + RingBuffer *ring{ctx->AsyncEvents.get()}; auto evt_data = ring->getWriteVector().first; if(evt_data.len == 0) { |