diff options
author | Robin Gareus <robin@gareus.org> | 2015-07-02 19:46:38 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-07-02 19:46:38 +0200 |
commit | 9e2048decf7c5671e611fb6239b9b73b2c68d2d5 (patch) | |
tree | fcf276a6c7cc70f7277fe564812faff731e7d3d9 /libs/ardour/session_state.cc | |
parent | 466af2a80bd4d30b46074c9da05f26f083272358 (diff) |
Don’t use invalid iterator during cleanup. fixes #6403
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index a921747ac2..6dc5462d58 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2888,6 +2888,8 @@ Session::cleanup_sources (CleanupReport& rep) in the region list. */ + std::string fpath = i->second->name (); + RegionFactory::remove_regions_using_source (i->second); sources.erase (i); @@ -2895,7 +2897,7 @@ Session::cleanup_sources (CleanupReport& rep) for (set<string>::iterator j = all_sources.begin(); j != all_sources.end(); ++j) { spath = Glib::path_get_basename (*j); - if ( spath == i->second->name () ) { + if ( spath == fpath ) { all_sources.erase (j); break; } |