summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/session.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour/session.h')
-rw-r--r--libs/ardour/ardour/session.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 4c93ecb95f..4c259232f5 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -646,23 +646,27 @@ public:
};
class ProcessorChangeBlocker {
- public:
- ProcessorChangeBlocker (Session* s, bool rc = true)
- : _session (s)
- , _reconfigure_on_delete (rc)
- {
- g_atomic_int_inc (&s->_ignore_route_processor_changes);
- }
- ~ProcessorChangeBlocker () {
- if (g_atomic_int_dec_and_test (&_session->_ignore_route_processor_changes)) {
+ public:
+ ProcessorChangeBlocker (Session* s, bool rc = true)
+ : _session (s)
+ , _reconfigure_on_delete (rc)
+ {
+ g_atomic_int_inc (&s->_ignore_route_processor_changes);
+ }
+
+ ~ProcessorChangeBlocker ()
+ {
+ if (g_atomic_int_dec_and_test (&_session->_ignore_route_processor_changes)) {
+ if (g_atomic_int_compare_and_exchange (&_session->_ignored_a_processor_change, 1, 0)) {
if (_reconfigure_on_delete) {
_session->route_processors_changed (RouteProcessorChange ());
}
}
}
- private:
- Session* _session;
- bool _reconfigure_on_delete;
+ }
+ private:
+ Session* _session;
+ bool _reconfigure_on_delete;
};
RouteGroup* new_route_group (const std::string&);
@@ -2128,6 +2132,7 @@ private:
friend class ProcessorChangeBlocker;
gint _ignore_route_processor_changes; /* atomic */
+ gint _ignored_a_processor_change;
MidiClockTicker* midi_clock;