diff options
author | Chris Robinson <[email protected]> | 2019-04-10 13:05:21 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-04-10 13:05:21 -0700 |
commit | f39d4598b7dedfca92fc6bcb4eedf646656db7b3 (patch) | |
tree | 4532654cc17feefea0d6d132a906e56937e2631b /OpenAL32/event.cpp | |
parent | d6f72b777a058f3feb42eb109b0baf66070c0528 (diff) |
Add exception protection to some AL functions
Diffstat (limited to 'OpenAL32/event.cpp')
-rw-r--r-- | OpenAL32/event.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/OpenAL32/event.cpp b/OpenAL32/event.cpp index a2e3addd..f01227e9 100644 --- a/OpenAL32/event.cpp +++ b/OpenAL32/event.cpp @@ -13,6 +13,7 @@ #include "alAuxEffectSlot.h" #include "ringbuffer.h" #include "threads.h" +#include "alexcpt.h" static int EventThread(ALCcontext *context) @@ -129,6 +130,7 @@ void StopEventThrd(ALCcontext *ctx) } AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, ALboolean enable) +START_API_FUNC { ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; @@ -186,8 +188,10 @@ AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, A std::lock_guard<std::mutex>{context->EventCbLock}; } } +END_API_FUNC AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *userParam) +START_API_FUNC { ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; @@ -197,3 +201,4 @@ AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *user context->EventCb = callback; context->EventParam = userParam; } +END_API_FUNC |