output/wasapi: release the COMWorker if OpenDevice() fails
Fixes assertion failure in the Thread destructor.
This commit is contained in:
		| @@ -205,7 +205,13 @@ public: | ||||
| 	WasapiOutput(const ConfigBlock &block); | ||||
| 	void Enable() override { | ||||
| 		COMWorker::Aquire(); | ||||
| 		COMWorker::Async([&]() { OpenDevice(); }).get(); | ||||
|  | ||||
| 		try { | ||||
| 			COMWorker::Async([&]() { OpenDevice(); }).get(); | ||||
| 		} catch (...) { | ||||
| 			COMWorker::Release(); | ||||
| 			throw; | ||||
| 		} | ||||
| 	} | ||||
| 	void Disable() noexcept override { | ||||
| 		COMWorker::Async([&]() { DoDisable(); }).get(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann