Release all the things

This commit is contained in:
Albert Vaca Cintora 2023-05-25 13:02:16 +02:00
parent 9ce7a676bd
commit 4510762af5

View file

@ -227,6 +227,15 @@ SystemvolumePlugin::SystemvolumePlugin(QObject *parent, const QVariantList &args
SystemvolumePlugin::~SystemvolumePlugin()
{
if (valid) {
QSet<IAudioEndpointVolume*> endpoints;
for (auto &entry : sinkList.toStdMap()) {
endpoint->UnRegisterControlChangeNotify(entry.second);
endpoint->Release();
endpoints.insert(entry.first);
}
for (IAudioEndpointVolume* endpoint : endpoints) {
endpoint->Release();
}
deviceEnumerator->UnregisterEndpointNotificationCallback(deviceCallback);
deviceEnumerator->Release();
deviceEnumerator = nullptr;