mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user