mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 04:06:26 +01:00
Fix use of invalidated iterator (#4822).
git-svn-id: svn://localhost/ardour2/branches/3.0@11893 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
b788b7c56c
commit
86a86f482f
1 changed files with 8 additions and 1 deletions
|
|
@ -620,10 +620,17 @@ RegionFactory::remove_regions_using_source (boost::shared_ptr<Source> src)
|
||||||
{
|
{
|
||||||
Glib::Mutex::Lock lm (region_map_lock);
|
Glib::Mutex::Lock lm (region_map_lock);
|
||||||
|
|
||||||
for (RegionMap::iterator i = region_map.begin(); i != region_map.end(); ++i) {
|
RegionMap::iterator i = region_map.begin();
|
||||||
|
while (i != region_map.end()) {
|
||||||
|
|
||||||
|
RegionMap::iterator j = i;
|
||||||
|
++j;
|
||||||
|
|
||||||
if (i->second->uses_source (src)) {
|
if (i->second->uses_source (src)) {
|
||||||
region_map.erase (i);
|
region_map.erase (i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue