summaryrefslogtreecommitdiff
path: root/libs/pbd/controllable.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-05-15 15:32:53 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-05-15 15:32:53 +0000
commit23f03f995f850898c1e8d133db318a210774bcd7 (patch)
treefd5dcd2ee25454dbff403a7e09e94b641d1734c5 /libs/pbd/controllable.cc
parent2fb30ea54d073dc4134bbe24e09c573eaf33e658 (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/pbd/controllable.cc')
-rw-r--r--libs/pbd/controllable.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/pbd/controllable.cc b/libs/pbd/controllable.cc
index d4ceefe330..82a8464c8b 100644
--- a/libs/pbd/controllable.cc
+++ b/libs/pbd/controllable.cc
@@ -36,7 +36,7 @@ PBD::Signal1<void,Controllable*> Controllable::DeleteBinding;
Glib::StaticRWLock Controllable::registry_lock = GLIBMM_STATIC_RW_LOCK_INIT;
Controllable::Controllables Controllable::registry;
-PBD::ScopedConnectionList registry_connections;
+PBD::ScopedConnectionList* registry_connections = 0;
const std::string Controllable::xml_node_name = X_("Controllable");
Controllable::Controllable (const string& name, Flag f)
@@ -55,9 +55,13 @@ Controllable::add (Controllable& ctl)
Glib::RWLock::WriterLock lm (registry_lock);
registry.insert (&ctl);
+ if (!registry_connections) {
+ registry_connections = new ScopedConnectionList;
+ }
+
/* Controllable::remove() is static - no need to manage this connection */
- ctl.DropReferences.connect_same_thread (registry_connections, boost::bind (&Controllable::remove, &ctl));
+ ctl.DropReferences.connect_same_thread (*registry_connections, boost::bind (&Controllable::remove, &ctl));
}
void