Handle mutual recursion while loading presets

This commit is contained in:
Robbert van der Helm
2021-04-29 23:09:20 +02:00
parent 74dd7f61a2
commit cb07fd07a2
2 changed files with 16 additions and 14 deletions
+2
View File
@@ -81,6 +81,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Fixed the VST3 version of _W. A. Production ImPerfect_ from crashing during
audio setup.
- Fixed _UVI Plugsound Free_ crashing during initialization.
- Fixed a rare potential freeze when loading a VST3 plugin preset while the
plugin is being resized.
- Because of the new transport information prefetching, the excessive DSP usage
in _SWAM Cello_ is now been fixed without requiring any manual compatibility
options.
+14 -14
View File
@@ -234,20 +234,20 @@ void Vst3Bridge::run() {
-> Vst3PluginProxy::SetState::Response {
// We need to run `getState()` from the main thread, so we might
// as well do the same thing with `setState()`. See below.
return main_context
.run_in_context<tresult>([&]() {
// This same function is defined in both `IComponent`
// and `IEditController`, so the host is calling one or
// the other
if (object_instances[request.instance_id].component) {
return object_instances[request.instance_id]
.component->setState(&request.state);
} else {
return object_instances[request.instance_id]
.edit_controller->setState(&request.state);
}
})
.get();
// NOTE: We also try to handle mutual recursion here, in case
// this happens during a resize
return do_mutual_recursion_on_gui_thread<tresult>([&]() {
// This same function is defined in both `IComponent` and
// `IEditController`, so the host is calling one or the
// other
if (object_instances[request.instance_id].component) {
return object_instances[request.instance_id]
.component->setState(&request.state);
} else {
return object_instances[request.instance_id]
.edit_controller->setState(&request.state);
}
});
},
[&](Vst3PluginProxy::GetState& request)
-> Vst3PluginProxy::GetState::Response {