aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/event.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-09-21 02:37:37 -0700
committerChris Robinson <[email protected]>2018-09-21 04:14:15 -0700
commitb6d0ff02c2ec52d2c12a58f2be83b4c3eaa93afe (patch)
treef0d8d0d56589b38d623dd746ff7435d3a63026b6 /OpenAL32/event.c
parentf21e2df4cf0d51fda31f5607e1bf966459d9bf9d (diff)
Use an internal event to more timely release old effect states
Diffstat (limited to 'OpenAL32/event.c')
-rw-r--r--OpenAL32/event.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/OpenAL32/event.c b/OpenAL32/event.c
index c0bf4204..4c9c0be2 100644
--- a/OpenAL32/event.c
+++ b/OpenAL32/event.c
@@ -6,6 +6,7 @@
#include "AL/alext.h"
#include "alMain.h"
#include "alError.h"
+#include "alAuxEffectSlot.h"
#include "ringbuffer.h"
@@ -30,6 +31,12 @@ int EventThread(void *arg)
quitnow = evt.EnumType == EventType_KillThread;
if(quitnow) break;
+ if(evt.EnumType == EventType_ReleaseEffectState)
+ {
+ ALeffectState_DecRef(evt.u.EffectState);
+ continue;
+ }
+
enabledevts = ATOMIC_LOAD(&context->EnabledEvts, almemory_order_acquire);
if(context->EventCb && (enabledevts&evt.EnumType) == evt.EnumType)
context->EventCb(evt.u.user.type, evt.u.user.id, evt.u.user.param,