cleanup
This commit is contained in:
@@ -37,13 +37,54 @@ AudioDevice::~AudioDevice()
|
||||
if (volumeInterface)
|
||||
{
|
||||
volumeInterface->Release();
|
||||
volumeInterface = nullptr;
|
||||
}
|
||||
if (meterInterface)
|
||||
{
|
||||
meterInterface->Release();
|
||||
meterInterface = nullptr;
|
||||
}
|
||||
if (device)
|
||||
{
|
||||
device->Release();
|
||||
device = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
AudioData::AudioData()
|
||||
{
|
||||
}
|
||||
|
||||
AudioData::AudioData(AudioData&& other) noexcept
|
||||
: playbackDevices(std::move(other.playbackDevices)), recordingDevices(std::move(other.recordingDevices)),
|
||||
deviceEnumerator(other.deviceEnumerator), audioNotificationListener(other.audioNotificationListener)
|
||||
{
|
||||
other.deviceEnumerator = nullptr;
|
||||
other.audioNotificationListener = nullptr;
|
||||
}
|
||||
|
||||
AudioData& AudioData::operator=(AudioData&& other) noexcept
|
||||
{
|
||||
playbackDevices = std::move(other.playbackDevices);
|
||||
recordingDevices = std::move(other.recordingDevices);
|
||||
deviceEnumerator = other.deviceEnumerator;
|
||||
audioNotificationListener = other.audioNotificationListener;
|
||||
|
||||
other.deviceEnumerator = nullptr;
|
||||
other.audioNotificationListener = nullptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
AudioData::~AudioData()
|
||||
{
|
||||
if (deviceEnumerator)
|
||||
{
|
||||
deviceEnumerator->Release();
|
||||
deviceEnumerator = nullptr;
|
||||
}
|
||||
if (audioNotificationListener)
|
||||
{
|
||||
audioNotificationListener->Release();
|
||||
audioNotificationListener = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user