summaryrefslogtreecommitdiff
path: root/libs/pbd/receiver.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd/receiver.cc')
-rw-r--r--libs/pbd/receiver.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/libs/pbd/receiver.cc b/libs/pbd/receiver.cc
index b0655721ad..689665c84a 100644
--- a/libs/pbd/receiver.cc
+++ b/libs/pbd/receiver.cc
@@ -37,23 +37,17 @@ Receiver::~Receiver ()
void
Receiver::hangup ()
{
- vector<sigc::connection *>::iterator i;
-
- for (i = connections.begin(); i != connections.end (); i++) {
- (*i)->disconnect ();
- delete *i;
- }
-
- connections.erase (connections.begin(), connections.end());
+ connections.drop_connections ();
}
void
Receiver::listen_to (Transmitter &transmitter)
{
- sigc::connection *c = new sigc::connection;
-
- (*c) = transmitter.sender().connect(mem_fun(*this, &Receiver::receive));
+ /* odd syntax here because boost's placeholders (_1, _2) are in an
+ anonymous namespace which causes ambiguity with sigc++ (and will also
+ do so with std::placeholder in the C++11 future
+ */
+ transmitter.sender().connect_same_thread (connections, boost::bind (&Receiver::receive, this, boost::arg<1>(), boost::arg<2>()));
- connections.push_back (c);
}