Catch exceptions in failing host callbacks

This will let us more or less gracefully handle failing host callbacks
during initialization. We cannot catch this from anywhere else since
this these functions get called from unmanaged code.
This commit is contained in:
Robbert van der Helm
2021-05-01 17:56:42 +02:00
parent 832089d4d1
commit bda9a0b75f
+9 -2
View File
@@ -657,6 +657,13 @@ intptr_t VST_CALL_CONV host_callback_proxy(AEffect* effect,
intptr_t value,
void* data,
float option) {
return get_bridge_instance(effect).host_callback(effect, opcode, index,
value, data, option);
try {
return get_bridge_instance(effect).host_callback(effect, opcode, index,
value, data, option);
} catch (const boost::system::system_error& error) {
std::cerr << "Error while handling callback:" << std::endl;
std::cerr << error.what() << std::endl;
return -1;
}
}