output/wasapi: SafeTry() catches all exceptions
Fixes crash due to std::stoul() throwing std::invalid_argument.
This commit is contained in:
parent
9ff790b7bb
commit
17f7098e27
@ -90,8 +90,8 @@ inline bool SafeTry(Functor &&functor) {
|
|||||||
try {
|
try {
|
||||||
functor();
|
functor();
|
||||||
return true;
|
return true;
|
||||||
} catch (std::runtime_error &err) {
|
} catch (...) {
|
||||||
FormatError(wasapi_output_domain, "%s", err.what());
|
FormatError(std::current_exception(), "%s");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ inline bool SafeSilenceTry(Functor &&functor) {
|
|||||||
try {
|
try {
|
||||||
functor();
|
functor();
|
||||||
return true;
|
return true;
|
||||||
} catch (std::runtime_error &err) {
|
} catch (...) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user