Skip to content
Commit 844d52f0 authored by Art Pinch's avatar Art Pinch
Browse files

Fixed kdeconnectd deadlock on Windows caused by systemvolumeplugin

IAudioEndpointVolumeCallback::Release was called in callback functions of IMMNotificationClient (through the call to SystemvolumePlugin::sendSinkList), however https://docs.microsoft.com/en-us/windows/win32/api/mmdeviceapi/nn-mmdeviceapi-immnotificationclient points out that:
*To avoid dead locks, the client should never call IMMDeviceEnumerator::RegisterEndpointNotificationCallback or IMMDeviceEnumerator::UnregisterEndpointNotificationCallback in its implementation of IMMNotificationClient methods.
*The client should never release the final reference on an MMDevice API object during an event callback.

So I moved that part of code to another thread so it will successfully run after callback functions work out and call only if endpoint needs to be released (device was removed), so it won't spawn new thread for every generated event
parent bb619baa
Pipeline #41843 passed with stage
in 5 minutes and 26 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment