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/filter.cpp | |
parent | 4917024c9485d5ed3362ddcb1a0d0f8ee45dfedc (diff) |
Use a smart pointer for holding the context's device
Diffstat (limited to 'al/filter.cpp')
-rw-r--r-- | al/filter.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/al/filter.cpp b/al/filter.cpp index 5009daae..b52267f1 100644 --- a/al/filter.cpp +++ b/al/filter.cpp @@ -278,7 +278,7 @@ void InitFilterParams(ALfilter *filter, ALenum type) ALfilter *AllocFilter(ALCcontext *context) { - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; auto sublist = std::find_if(device->FilterList.begin(), device->FilterList.end(), [](const FilterSubList &entry) noexcept -> bool @@ -410,7 +410,7 @@ START_API_FUNC if(UNLIKELY(n == 0)) return; - ALCdevice *device{context->mDevice}; + ALCdevice *device{context->mDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; /* First try to find any filters that are invalid. */ @@ -448,7 +448,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->FilterLock}; if(!filter || LookupFilter(device, filter)) return AL_TRUE; @@ -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->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; @@ -502,7 +502,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->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; @@ -522,7 +522,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->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; @@ -542,7 +542,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->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; @@ -562,7 +562,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->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; @@ -594,7 +594,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->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; @@ -614,7 +614,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->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; @@ -634,7 +634,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->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; |