diff options
author | Chris Robinson <[email protected]> | 2019-08-01 19:44:09 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-01 19:44:09 -0700 |
commit | 33bcced82a1e97811d4212195b6e6ca9cf2242b1 (patch) | |
tree | 9431019a2288668260e92cc1522ba686c04f6e0f /al/effect.cpp | |
parent | 4917024c9485d5ed3362ddcb1a0d0f8ee45dfedc (diff) |
Use a smart pointer for holding the context's device
Diffstat (limited to 'al/effect.cpp')
-rw-r--r-- | al/effect.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/al/effect.cpp b/al/effect.cpp index 2d72916e..15200a88 100644 --- a/al/effect.cpp +++ b/al/effect.cpp @@ -138,7 +138,7 @@ void InitEffectParams(ALeffect *effect, ALenum type) ALeffect *AllocEffect(ALCcontext *context) { - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; auto sublist = std::find_if(device->EffectList.begin(), device->EffectList.end(), [](const EffectSubList &entry) noexcept -> bool @@ -269,7 +269,7 @@ START_API_FUNC if(UNLIKELY(n == 0)) return; - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; /* First try to find any effects that are invalid. */ @@ -307,7 +307,7 @@ START_API_FUNC ContextRef context{GetContextRef()}; if(LIKELY(context)) { - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; if(!effect || LookupEffect(device, effect)) return AL_TRUE; @@ -322,7 +322,7 @@ START_API_FUNC ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; ALeffect *aleffect{LookupEffect(device, effect)}; @@ -372,7 +372,7 @@ START_API_FUNC ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; ALeffect *aleffect{LookupEffect(device, effect)}; @@ -392,7 +392,7 @@ START_API_FUNC ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; ALeffect *aleffect{LookupEffect(device, effect)}; @@ -412,7 +412,7 @@ START_API_FUNC ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; ALeffect *aleffect{LookupEffect(device, effect)}; @@ -432,7 +432,7 @@ START_API_FUNC ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; const ALeffect *aleffect{LookupEffect(device, effect)}; @@ -464,7 +464,7 @@ START_API_FUNC ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; const ALeffect *aleffect{LookupEffect(device, effect)}; @@ -484,7 +484,7 @@ START_API_FUNC ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; const ALeffect *aleffect{LookupEffect(device, effect)}; @@ -504,7 +504,7 @@ START_API_FUNC ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->EffectLock}; const ALeffect *aleffect{LookupEffect(device, effect)}; |