diff options
author | Carl Hetherington <carl@carlh.net> | 2011-11-15 18:32:24 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-11-15 18:32:24 +0000 |
commit | 301ed17f957e906b2f87fda752c263ccf8e5c30b (patch) | |
tree | 1766a1454743594657288066eaac47b2171b336b /libs/ardour/session_state.cc | |
parent | 6822b37c7fda7e3ce8e1c2977923ce9de72659f8 (diff) |
Remove unused MIDI regions as well as audio ones
(#3793).
git-svn-id: svn://localhost/ardour2/branches/3.0@10620 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 5096401226..e4febc5314 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2663,16 +2663,10 @@ Session::cleanup_regions () for (RegionFactory::RegionMap::const_iterator i = regions.begin(); i != regions.end(); ++i) { - boost::shared_ptr<AudioRegion> audio_region = boost::dynamic_pointer_cast<AudioRegion>( i->second); + uint32_t used = playlists->region_use_count (i->second); - if (!audio_region) { - continue; - } - - uint32_t used = playlists->region_use_count (audio_region); - - if (used == 0 && !audio_region->automatic()) { - RegionFactory::map_remove(i->second); + if (used == 0 && !i->second->automatic ()) { + RegionFactory::map_remove (i->second); } } |