diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -2147,17 +2147,14 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context) } UnlockDevice(Device); + if(CompExchangePtr((void**)&GlobalContext, context, NULL)) + ALCcontext_DecRef(context); + if(Device->NumContexts == 0) { ALCdevice_StopPlayback(Device); Device->Flags &= ~DEVICE_RUNNING; } - - if(GlobalContext == context) - { - GlobalContext = NULL; - ALCcontext_DecRef(context); - } UnlockLists(); ALCcontext_DecRef(context); |