1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Windows: Fixed a crash when releasing a specific ASIO driver

This commit is contained in:
ed 2019-07-22 14:00:49 +01:00
parent ff70ebb03e
commit a5424b3798

View file

@ -1075,11 +1075,21 @@ private:
}
}
static bool shouldReleaseObject (const String& driverName)
{
return driverName != "Yamaha Steinberg USB ASIO";
}
void removeCurrentDriver()
{
if (asioObject != nullptr)
{
asioObject->Release();
char buffer[512] = {};
asioObject->getDriverName (buffer);
if (shouldReleaseObject (buffer))
asioObject->Release();
asioObject = nullptr;
}
}
@ -1127,7 +1137,7 @@ private:
if (asioObject == nullptr)
return "No Driver";
const bool initOk = !! asioObject->init (juce_messageWindowHandle);
auto initOk = (asioObject->init (juce_messageWindowHandle) > 0);
String driverError;
// Get error message if init() failed, or if it's a buggy Denon driver,