13
0

Remove bind to shared_ptr.

git-svn-id: svn://localhost/ardour2/branches/3.0@12281 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-05-15 00:06:26 +00:00
parent 5bbbc98533
commit 67b74ed1c7
2 changed files with 8 additions and 3 deletions

View File

@ -83,7 +83,7 @@ public:
static void get_regions_using_source (boost::shared_ptr<Source>, std::set<boost::shared_ptr<Region> >& );
static void remove_regions_using_source (boost::shared_ptr<Source>);
static void map_remove (boost::shared_ptr<Region>);
static void map_remove (boost::weak_ptr<Region>);
static void map_remove_with_equivalents (boost::shared_ptr<Region>);
static void delete_all_regions ();
static const RegionMap& regions() { return region_map; }

View File

@ -321,7 +321,7 @@ RegionFactory::map_add (boost::shared_ptr<Region> r)
region_map.insert (p);
}
r->DropReferences.connect_same_thread (region_list_connections, boost::bind (&RegionFactory::map_remove, r));
r->DropReferences.connect_same_thread (region_list_connections, boost::bind (&RegionFactory::map_remove, boost::weak_ptr<Region> (r)));
r->PropertyChanged.connect_same_thread (
region_list_connections,
@ -332,8 +332,13 @@ RegionFactory::map_add (boost::shared_ptr<Region> r)
}
void
RegionFactory::map_remove (boost::shared_ptr<Region> r)
RegionFactory::map_remove (boost::weak_ptr<Region> w)
{
boost::shared_ptr<Region> r = w.lock ();
if (!r) {
return;
}
Glib::Mutex::Lock lm (region_map_lock);
RegionMap::iterator i = region_map.find (r->id());