aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSoundfont.c
diff options
context:
space:
mode:
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);
}