summaryrefslogtreecommitdiff
path: root/gtk2_ardour/mixer_strip.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-10-28 17:04:09 +0000
committerCarl Hetherington <carl@carlh.net>2011-10-28 17:04:09 +0000
commit7bdcc127e3e42bd76b997b56ecd938b1127d790b (patch)
treef1e9856094ee5a54cc28957508f2b693fbcd043a /gtk2_ardour/mixer_strip.cc
parentf65e3f287b48fef6d4fdb8c4456c0eada4c4431c (diff)
Use shared_ptr for Port in the AudioEngine; improves thread-safety of the audio engine's port list as a writer cannot destroy a port in one thread while the port list is being iterated in another.
git-svn-id: svn://localhost/ardour2/branches/3.0@10327 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/mixer_strip.cc')
-rw-r--r--gtk2_ardour/mixer_strip.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index dffda5bed4..39b1971080 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -993,7 +993,7 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt
{
uint32_t io_count;
uint32_t io_index;
- Port *port;
+ boost::shared_ptr<Port> port;
vector<string> port_connections;
uint32_t total_connection_count = 0;
@@ -1185,8 +1185,15 @@ MixerStrip::diskstream_changed ()
}
void
-MixerStrip::port_connected_or_disconnected (Port* a, Port* b)
+MixerStrip::port_connected_or_disconnected (boost::weak_ptr<Port> wa, boost::weak_ptr<Port> wb)
{
+ boost::shared_ptr<Port> a = wa.lock ();
+ boost::shared_ptr<Port> b = wb.lock ();
+
+ if (!a || !b) {
+ return;
+ }
+
if (_route->input()->has_port (a) || _route->input()->has_port (b)) {
update_input_display ();
set_width_enum (_width, this);