use state Session::StateProtector

This commit is contained in:
Robin Gareus 2014-06-28 21:36:13 +02:00
parent ecd11253c1
commit 4a7eb62bf8
2 changed files with 11 additions and 2 deletions

View File

@ -6565,8 +6565,11 @@ edit your ardour.rc file to set the\n\
return;
}
for (vector<boost::shared_ptr<Route> >::iterator x = routes.begin(); x != routes.end(); ++x) {
_session->remove_route (*x);
{
Session::StateProtector sp (_session);
for (vector<boost::shared_ptr<Route> >::iterator x = routes.begin(); x != routes.end(); ++x) {
_session->remove_route (*x);
}
}
}

View File

@ -1882,6 +1882,7 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output, boost:
failed:
if (!new_routes.empty()) {
StateProtector sp (this);
add_routes (new_routes, true, true, true);
if (instrument) {
@ -2123,6 +2124,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
failed:
if (!new_routes.empty()) {
StateProtector sp (this);
add_routes (new_routes, true, true, true);
}
@ -2208,6 +2210,7 @@ Session::new_audio_route (int input_channels, int output_channels, RouteGroup* r
failure:
if (!ret.empty()) {
StateProtector sp (this);
add_routes (ret, false, true, true); // autoconnect outputs only
}
@ -2324,6 +2327,7 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
out:
if (!ret.empty()) {
StateProtector sp (this);
add_routes (ret, true, true, true);
IO::enable_connecting ();
}
@ -3059,6 +3063,8 @@ Session::reassign_track_numbers ()
SignalOrderRouteSorter sorter;
r.sort (sorter);
StateProtector sp (this);
for (RouteList::iterator i = r.begin(); i != r.end(); ++i) {
if (boost::dynamic_pointer_cast<Track> (*i)) {
(*i)->set_track_number(++tn);