summaryrefslogtreecommitdiff
path: root/libs/ardour/port.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-01-02 19:38:43 +0000
committerCarl Hetherington <carl@carlh.net>2009-01-02 19:38:43 +0000
commit9935b950eee30183d17c44ae822146acc3886915 (patch)
tree0dc8fdcc5f6d477d4d0cd03bc2abea2b53291aa6 /libs/ardour/port.cc
parentd5427db306b3eeb6292a7662fe129ed20dfc66ce (diff)
Ports say when they're going away.
git-svn-id: svn://localhost/ardour2/branches/3.0@4380 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/port.cc')
-rw-r--r--libs/ardour/port.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc
index 7aadb9183f..f3e0739e83 100644
--- a/libs/ardour/port.cc
+++ b/libs/ardour/port.cc
@@ -34,6 +34,7 @@ Port::Port (const std::string& name, Flags flgs)
Port::~Port ()
{
+ drop_references ();
disconnect_all ();
}
@@ -59,6 +60,7 @@ Port::connect (Port& other)
result = _connections.insert (&other);
if (result.second) {
+ other.GoingAway.connect (sigc::bind (mem_fun (*this, &Port::port_going_away), &other));
return 0;
} else {
return 1;
@@ -131,6 +133,14 @@ Port::get_connections (vector<string>& names) const
return i;
}
+void
+Port::port_going_away (Port* p)
+{
+ /* caller must hold process lock */
+
+ disconnect (*p);
+}
+
//-------------------------------------
@@ -377,3 +387,4 @@ PortFacade::reset ()
_ext_port->reset ();
}
}
+