Notify owners when removing regions during cleanup

Previously the region was only removed from the Session's
region_map without sending notifications.
This commit is contained in:
Robin Gareus 2020-02-25 15:17:44 +01:00
parent 8e1a2d7caa
commit fc91c217d1
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -663,19 +663,17 @@ void
RegionFactory::remove_regions_using_source (boost::shared_ptr<Source> src)
{
Glib::Threads::Mutex::Lock lm (region_map_lock);
RegionMap::iterator i = region_map.begin();
while (i != region_map.end()) {
RegionMap::iterator j = i;
++j;
RegionList remove_regions;
for (RegionMap::const_iterator i = region_map.begin(); i != region_map.end(); ++i) {
if (i->second->uses_source (src)) {
remove_from_region_name_map (i->second->name ());
region_map.erase (i);
}
remove_regions.push_back (i->second);
}
}
lm.release ();
i = j;
/* this will call RegionFactory::map_remove () */
for (RegionList::iterator i = remove_regions.begin(); i != remove_regions.end(); ++i) {
(*i)->drop_references ();
}
}