mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
RegionFX: fix undo/redo of region state
Previously this caused deadlocks (read lock while holding write lock), and also not dropped references of plugins. Ideally undo/redo of FX unrelated region state will not re-instantiate plugins; we can optimize this later.
This commit is contained in:
parent
190cd657b9
commit
3ced8cc6bc
1 changed files with 5 additions and 0 deletions
|
|
@ -1579,6 +1579,10 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang
|
|||
Glib::Threads::RWLock::WriterLock lm (_fx_lock);
|
||||
bool changed = !_plugins.empty ();
|
||||
|
||||
for (auto const& rfx : _plugins) {
|
||||
rfx->drop_references ();
|
||||
}
|
||||
|
||||
_plugins.clear ();
|
||||
|
||||
for (auto const& child : node.children ()) {
|
||||
|
|
@ -1596,6 +1600,7 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang
|
|||
changed = true;
|
||||
}
|
||||
}
|
||||
lm.release ();
|
||||
if (changed) {
|
||||
fx_latency_changed (true);
|
||||
fx_tail_changed (true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue