aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSoundfont.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-09-03 16:29:17 -0700
committerChris Robinson <[email protected]>2014-09-03 16:29:17 -0700
commit2f2768e7c3a7e0dd5d926ea1eafb7313a58a07d9 (patch)
treeeddd9846a1d55838d6c566b03f9bb542c2f1c69e /OpenAL32/alSoundfont.c
parent30e01a7dba78826ab4b0099a313c6f8a46656e42 (diff)
Make the fontsound's buffer and link fields atomic
Diffstat (limited to 'OpenAL32/alSoundfont.c')
-rw-r--r--OpenAL32/alSoundfont.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/OpenAL32/alSoundfont.c b/OpenAL32/alSoundfont.c
index 30c97a3a..44f5c35c 100644
--- a/OpenAL32/alSoundfont.c
+++ b/OpenAL32/alSoundfont.c
@@ -395,10 +395,11 @@ void ALsoundfont_deleteSoundfont(ALsoundfont *self, ALCdevice *device)
{
if(sounds[j] && ReadRef(&sounds[j]->ref) == 0)
{
+ ALbuffer *buffer;
+
deleting = AL_TRUE;
- if(sounds[j]->Buffer)
+ if((buffer=ATOMIC_LOAD(&sounds[j]->Buffer)) != NULL)
{
- ALbuffer *buffer = sounds[j]->Buffer;
ALbuffer **iter;
#define MATCH_BUFFER(_i) (buffer == *(_i))
@@ -423,8 +424,8 @@ void ALsoundfont_deleteSoundfont(ALsoundfont *self, ALCdevice *device)
DeleteBuffer(device, *(iter)); \
} while(0)
VECTOR_FOR_EACH(ALbuffer*, buffers, DELETE_BUFFER);
- VECTOR_DEINIT(buffers);
#undef DELETE_BUFFER
+ VECTOR_DEINIT(buffers);
}