aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 9f4f7a30..2435558d 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1857,7 +1857,8 @@ void aluHandleDisconnect(ALCdevice *device, const char *msg, ...)
va_list args;
int msglen;
- device->Connected = ALC_FALSE;
+ if(!ATOMIC_EXCHANGE(&device->Connected, AL_FALSE, almemory_order_acq_rel))
+ return;
evt.EnumType = EventType_Disconnected;
evt.Type = AL_EVENT_TYPE_DISCONNECTED_SOFT;