aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--OpenAL32/alSource.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 0da513aa..757c96db 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -2810,8 +2810,9 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint src, ALsizei nb, const ALu
source->queue = BufferListStart;
else
{
- while(BufferList->next != NULL)
- BufferList = ATOMIC_LOAD(&BufferList->next, almemory_order_relaxed);
+ ALbufferlistitem *next;
+ while((next=ATOMIC_LOAD(&BufferList->next, almemory_order_relaxed)) != NULL)
+ BufferList = next;
ATOMIC_STORE(&BufferList->next, BufferListStart, almemory_order_release);
}
WriteUnlock(&source->queue_lock);