RegionFX: fix crash when custom GUI thread sends change requests

This can happen with VST2s (e.g gvst) and some JUCE based plugins.
Previously that lead to a "programming error: no per-thread pool"
when the DR queues a overwrite buffer session-event.
This commit is contained in:
Robin Gareus 2024-08-17 05:29:04 +02:00
parent 76ee3339ac
commit d8725ff3c8
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -47,6 +47,7 @@
#include "ardour/analysis_graph.h"
#include "ardour/audioregion.h"
#include "ardour/buffer_manager.h"
#include "ardour/butler.h"
#include "ardour/session.h"
#include "ardour/dB.h"
#include "ardour/debug.h"
@ -2350,7 +2351,12 @@ AudioRegion::_add_plugin (std::shared_ptr<RegionFxPlugin> rfx, std::shared_ptr<R
return;
}
if (!_invalidated.exchange (true)) {
send_change (PropertyChange (Properties::region_fx)); // trigger DiskReader overwrite
/* catch changes from some custom plugin GUI threads (VST2, and JUCE) */
if (SessionEvent::has_per_thread_pool ()) {
send_change (PropertyChange (Properties::region_fx)); // trigger DiskReader overwrite
} else {
_session.butler ()->delegate (boost::bind (&AudioRegion::send_change, this, PropertyChange (Properties::region_fx)));
}
}
});
if (!ac->alist ()) {