diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-05-15 15:32:53 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-05-15 15:32:53 +0000 |
commit | 23f03f995f850898c1e8d133db318a210774bcd7 (patch) | |
tree | fd5dcd2ee25454dbff403a7e09e94b641d1734c5 /libs/ardour/region_factory.cc | |
parent | 2fb30ea54d073dc4134bbe24e09c573eaf33e658 (diff) |
remove two instances of static/global ScopedConnectionList. one remains worth thinking about for semantics (libs/pbd/controllable.cc:registry_connections)
git-svn-id: svn://localhost/ardour2/branches/3.0@12295 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/region_factory.cc')
-rw-r--r-- | libs/ardour/region_factory.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index f574097fea..6af256f169 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -41,7 +41,7 @@ using namespace std; PBD::Signal1<void,boost::shared_ptr<Region> > RegionFactory::CheckNewRegion; Glib::StaticMutex RegionFactory::region_map_lock; RegionFactory::RegionMap RegionFactory::region_map; -PBD::ScopedConnectionList RegionFactory::region_list_connections; +PBD::ScopedConnectionList* RegionFactory::region_list_connections = 0; Glib::StaticMutex RegionFactory::region_name_map_lock; std::map<std::string, uint32_t> RegionFactory::region_name_map; RegionFactory::CompoundAssociations RegionFactory::_compound_associations; @@ -321,12 +321,12 @@ 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, boost::weak_ptr<Region> (r))); + if (!region_list_connections) { + region_list_connections = new ScopedConnectionList; + } - r->PropertyChanged.connect_same_thread ( - region_list_connections, - boost::bind (&RegionFactory::region_changed, _1, boost::weak_ptr<Region> (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, boost::bind (&RegionFactory::region_changed, _1, boost::weak_ptr<Region> (r))); update_region_name_map (r); } @@ -384,7 +384,9 @@ RegionFactory::region_by_name (const std::string& name) void RegionFactory::clear_map () { - region_list_connections.drop_connections (); + if (region_list_connections) { + region_list_connections->drop_connections (); + } { Glib::Mutex::Lock lm (region_map_lock); |