diff options
author | Carl Hetherington <carl@carlh.net> | 2012-05-15 00:06:26 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-05-15 00:06:26 +0000 |
commit | 67b74ed1c7a3887ddd0e289c54c09ac8f7529518 (patch) | |
tree | 272dea61d51f64234b3ad9ffa77515b14009d915 /libs | |
parent | 5bbbc985338aec965237e9fdf3696ddff2bc1002 (diff) |
Remove bind to shared_ptr.
git-svn-id: svn://localhost/ardour2/branches/3.0@12281 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/region_factory.h | 2 | ||||
-rw-r--r-- | libs/ardour/region_factory.cc | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h index dfbcd480dd..337821e0ea 100644 --- a/libs/ardour/ardour/region_factory.h +++ b/libs/ardour/ardour/region_factory.h @@ -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; } diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index f739483821..b5195d80d9 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -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()); |