1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-22 23:30:07 +02:00

Make sure controls are empty if the last sound device is removed.

This commit is contained in:
lllucius 2014-12-06 03:41:33 +00:00
parent 71bfad1a4a
commit abaac6b443

View File

@ -545,12 +545,15 @@ void DeviceToolBar::FillHostDevices()
foundHostIndex = inMaps[0].hostIndex;
}
// Make sure in/out are clear in case no host was found
mInput->Clear();
mOutput->Clear();
// If we still have no host it means no devices, in which case do nothing.
if (foundHostIndex == -1)
return;
// Repopulate the Input/Output device list available to the user
mInput->Clear();
for (i = 0; i < inMaps.size(); i++) {
if (foundHostIndex == inMaps[i].hostIndex) {
mInput->Append(MakeDeviceSourceString(&inMaps[i]));
@ -566,7 +569,6 @@ void DeviceToolBar::FillHostDevices()
mInput->InvalidateBestSize();
mInput->SetMaxSize(mInput->GetBestSize());
mOutput->Clear();
for (i = 0; i < outMaps.size(); i++) {
if (foundHostIndex == outMaps[i].hostIndex) {
mOutput->Append(MakeDeviceSourceString(&outMaps[i]));