Handle setting channel infos as mutually recursive

This was causing a timing issue with DMG plugins where the plugins would
try to resize after receiving new state (and not during the call), while
REAPER at the same time would try to set channel context information on
the plugin (which also has to be handled on the GUI thread).
This commit is contained in:
Robbert van der Helm
2021-05-15 23:47:07 +02:00
parent 171d8facee
commit 70a546d160
2 changed files with 13 additions and 3 deletions
+2
View File
@@ -27,6 +27,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
### Fixed
- Prevent _DMG_ VST3 plugins from freezing in **REAPER** under certain
circumstances.
- Fixed builds on Wine 6.8 because of internal changes to Wine's `windows.h`
implementation.
+11 -3
View File
@@ -836,9 +836,17 @@ Vst3PluginProxyImpl::endEditFromHost(Steinberg::Vst::ParamID paramID) {
tresult PLUGIN_API Vst3PluginProxyImpl::setChannelContextInfos(
Steinberg::Vst::IAttributeList* list) {
if (list) {
return bridge.send_message(YaInfoListener::SetChannelContextInfos{
.instance_id = instance_id(),
.list = YaAttributeList::read_channel_context(list)});
// NOTE: After getting and setting state, the plugin may want to resize
// to match its old size. The DMG plugins tend to delay this
// request until after the state has been set, but at that point
// in time REAPER will also send channel context info. Both of
// these things need to be handled on the GUI thread on their
// receiving sides, resulting in a deadlock without this mutual
// recursion.
return maybe_send_mutually_recursive_message(
YaInfoListener::SetChannelContextInfos{
.instance_id = instance_id(),
.list = YaAttributeList::read_channel_context(list)});
} else {
bridge.logger.log(
"WARNING: Null pointer passed to "