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:
parent
ff70ebb03e
commit
a5424b3798
1 changed files with 12 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue