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
@ -1579,6 +1579,10 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang
|
|||||||
Glib::Threads::RWLock::WriterLock lm (_fx_lock);
|
Glib::Threads::RWLock::WriterLock lm (_fx_lock);
|
||||||
bool changed = !_plugins.empty ();
|
bool changed = !_plugins.empty ();
|
||||||
|
|
||||||
|
for (auto const& rfx : _plugins) {
|
||||||
|
rfx->drop_references ();
|
||||||
|
}
|
||||||
|
|
||||||
_plugins.clear ();
|
_plugins.clear ();
|
||||||
|
|
||||||
for (auto const& child : node.children ()) {
|
for (auto const& child : node.children ()) {
|
||||||
@ -1596,6 +1600,7 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang
|
|||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lm.release ();
|
||||||
if (changed) {
|
if (changed) {
|
||||||
fx_latency_changed (true);
|
fx_latency_changed (true);
|
||||||
fx_tail_changed (true);
|
fx_tail_changed (true);
|
||||||
|
Loading…
Reference in New Issue
Block a user