diff options
author | Chris Robinson <[email protected]> | 2019-04-14 02:16:42 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-04-14 04:05:07 -0700 |
commit | 61f7e7716c6743b16051d8c3ea4cea3b27d0197b (patch) | |
tree | 61b486a606cb2e3bac66b274fed8c75dbfad1d0a /Alc/backends/dsound.cpp | |
parent | 7f526780994f44793fe56a426c01fcebfb64a75a (diff) |
Remove the backend factory deinit method
It was never actually called anywhere, and there's no safe place where it can
be called. It's probably better to let the individual backends worry about
cleaning themselves up anyway.
Diffstat (limited to 'Alc/backends/dsound.cpp')
-rw-r--r-- | Alc/backends/dsound.cpp | 66 |
1 files changed, 25 insertions, 41 deletions
diff --git a/Alc/backends/dsound.cpp b/Alc/backends/dsound.cpp index 8b181d0d..00deafc1 100644 --- a/Alc/backends/dsound.cpp +++ b/Alc/backends/dsound.cpp @@ -99,38 +99,6 @@ HRESULT (WINAPI *pDirectSoundCaptureEnumerateW)(LPDSENUMCALLBACKW pDSEnumCallbac #endif -bool DSoundLoad(void) -{ -#ifdef HAVE_DYNLOAD - if(!ds_handle) - { - ds_handle = LoadLib("dsound.dll"); - if(!ds_handle) - { - ERR("Failed to load dsound.dll\n"); - return false; - } - -#define LOAD_FUNC(f) do { \ - p##f = reinterpret_cast<decltype(p##f)>(GetSymbol(ds_handle, #f)); \ - if(!p##f) \ - { \ - CloseLib(ds_handle); \ - ds_handle = nullptr; \ - return false; \ - } \ -} while(0) - LOAD_FUNC(DirectSoundCreate); - LOAD_FUNC(DirectSoundEnumerateW); - LOAD_FUNC(DirectSoundCaptureCreate); - LOAD_FUNC(DirectSoundCaptureEnumerateW); -#undef LOAD_FUNC - } -#endif - return true; -} - - #define MAX_UPDATES 128 struct DevMap { @@ -892,18 +860,34 @@ BackendFactory &DSoundBackendFactory::getFactory() } bool DSoundBackendFactory::init() -{ return DSoundLoad(); } - -void DSoundBackendFactory::deinit() { - PlaybackDevices.clear(); - CaptureDevices.clear(); - #ifdef HAVE_DYNLOAD - if(ds_handle) - CloseLib(ds_handle); - ds_handle = nullptr; + if(!ds_handle) + { + ds_handle = LoadLib("dsound.dll"); + if(!ds_handle) + { + ERR("Failed to load dsound.dll\n"); + return false; + } + +#define LOAD_FUNC(f) do { \ + p##f = reinterpret_cast<decltype(p##f)>(GetSymbol(ds_handle, #f)); \ + if(!p##f) \ + { \ + CloseLib(ds_handle); \ + ds_handle = nullptr; \ + return false; \ + } \ +} while(0) + LOAD_FUNC(DirectSoundCreate); + LOAD_FUNC(DirectSoundEnumerateW); + LOAD_FUNC(DirectSoundCaptureCreate); + LOAD_FUNC(DirectSoundCaptureEnumerateW); +#undef LOAD_FUNC + } #endif + return true; } bool DSoundBackendFactory::querySupport(BackendType type) |