diff options
author | Robin Gareus <robin@gareus.org> | 2016-11-10 23:04:12 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-11-10 23:20:58 +0100 |
commit | 9990da35d849f6cbb748062d161062cc5fd6640a (patch) | |
tree | eaea01c7d1a88aa8f6150eba88761f14236f518b /gtk2_ardour/route_processor_selection.cc | |
parent | 33942e6d5262610b9e62d7a95d144cfa343609a6 (diff) |
prevent crash during track-deletion (un-selecting deleted tracks)
Diffstat (limited to 'gtk2_ardour/route_processor_selection.cc')
-rw-r--r-- | gtk2_ardour/route_processor_selection.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gtk2_ardour/route_processor_selection.cc b/gtk2_ardour/route_processor_selection.cc index 729032e637..7428267b50 100644 --- a/gtk2_ardour/route_processor_selection.cc +++ b/gtk2_ardour/route_processor_selection.cc @@ -32,8 +32,8 @@ using namespace std; using namespace ARDOUR; using namespace PBD; +unsigned int RouteProcessorSelection::_no_route_change_signal = 0; RouteProcessorSelection::RouteProcessorSelection() - : _no_route_change_signal (false) { } @@ -76,7 +76,7 @@ RouteProcessorSelection::clear_routes () } axes.clear (); drop_connections (); - if (!_no_route_change_signal) { + if (0 == _no_route_change_signal) { RoutesChanged (); } } @@ -110,7 +110,7 @@ RouteProcessorSelection::add (AxisView* r) ms->CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RouteProcessorSelection::remove, this, _1), gui_context()); } - if (!_no_route_change_signal) { + if (0 == _no_route_change_signal) { RoutesChanged(); } } @@ -125,7 +125,7 @@ RouteProcessorSelection::remove (AxisView* r) if ((i = find (axes.begin(), axes.end(), r)) != axes.end()) { (*i)->set_selected (false); axes.erase (i); - if (!_no_route_change_signal) { + if (0 == _no_route_change_signal) { RoutesChanged (); } } @@ -153,5 +153,10 @@ RouteProcessorSelection::empty () void RouteProcessorSelection::block_routes_changed (bool yn) { - _no_route_change_signal = yn; + if (yn) { + ++_no_route_change_signal; + } else { + assert (_no_route_change_signal > 0); + --_no_route_change_signal; + } } |