aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/wasapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alc/backends/wasapi.cpp')
-rw-r--r--alc/backends/wasapi.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp
index a11f8ae9..ccdc54e7 100644
--- a/alc/backends/wasapi.cpp
+++ b/alc/backends/wasapi.cpp
@@ -891,8 +891,6 @@ int WasapiProxy::messageHandler(std::promise<HRESULT> *promise)
promise->set_value(S_OK);
promise = nullptr;
- sDeviceHelper.reset(new DeviceHelper{});
-
TRACE("Starting message loop\n");
while(Msg msg{popMessage()})
{
@@ -2217,6 +2215,9 @@ bool WasapiBackendFactory::init()
WARN("Failed to create IMMDeviceEnumerator instance: 0x%08lx\n", hr);
enumerator = nullptr;
#endif
+ if(SUCCEEDED(hr))
+ WasapiProxy::sDeviceHelper.reset(new DeviceHelper{});
+
CoUninitialize();
return hr;