From e745eb695283f209da7f47fa4c43d511fef1de12 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 2 Sep 2009 22:59:12 +0000 Subject: [PATCH] Modified version of Hans' patch for mantis 1985. Also remove unused port_connections array in AudioEngine. git-svn-id: svn://localhost/ardour2/branches/3.0@5621 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/audioengine.h | 6 ------ libs/ardour/audioengine.cc | 28 ++++++---------------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 9dec7c8ec3..cb8baf85df 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -238,12 +238,6 @@ class AudioEngine : public sigc::trackable int process_callback (nframes_t nframes); void remove_all_ports (); - typedef std::pair PortConnection; - typedef std::list PortConnections; - - PortConnections port_connections; - void remove_connections_for (Port&); - std::string get_nth_physical (DataType type, uint32_t n, int flags); void port_registration_failure (const std::string& portname); diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 7b69b54e26..17d5318f48 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -580,8 +580,7 @@ AudioEngine::remove_session () session = 0; } - //FIXME: Preliminary bugfix for http://tracker.ardour.org/view.php?id=1985 - //remove_all_ports (); + remove_all_ports (); } void @@ -682,8 +681,6 @@ AudioEngine::unregister_port (Port& port) /* writer goes out of scope, forces update */ } - remove_connections_for (port); - return 0; } @@ -1141,28 +1138,15 @@ AudioEngine::remove_all_ports () { RCUWriter writer (ports); boost::shared_ptr ps = writer.get_copy (); + + for (Ports::iterator i = ps->begin(); i != ps->end(); ++i) { + delete *i; + } + ps->clear (); } } -void -AudioEngine::remove_connections_for (Port& port) -{ - for (PortConnections::iterator i = port_connections.begin(); i != port_connections.end(); ) { - PortConnections::iterator tmp; - - tmp = i; - ++tmp; - - if ((*i).first == port.name()) { - port_connections.erase (i); - } - - i = tmp; - } -} - - static void ardour_jack_error (const char* msg) {