Release all the things
This commit is contained in:
parent
9ce7a676bd
commit
4510762af5
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue