aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/alBuffer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/OpenAL32/alBuffer.cpp b/OpenAL32/alBuffer.cpp
index b08518ba..196dcd22 100644
--- a/OpenAL32/alBuffer.cpp
+++ b/OpenAL32/alBuffer.cpp
@@ -502,7 +502,10 @@ AL_API ALvoid AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
/* All good. Delete non-0 buffer IDs. */
std::for_each(buffers, buffers_end,
[device](ALuint bid) -> void
- { if(bid) FreeBuffer(device, LookupBuffer(device, bid)); }
+ {
+ ALbuffer *buffer{bid ? LookupBuffer(device, bid) : nullptr};
+ if(buffer) FreeBuffer(device, buffer);
+ }
);
}
}