X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession.cc;h=c2c21a631d2bcfc393555d8eb5ee190d46fc71b5;hb=ead3796adeed06a7d314317d3ca65861409eebda;hp=d3b65210a405c65e196de60180e8b22412c8d899;hpb=dcaa9cd70d04c8f6eb63c814068c9fa5a60adc7e;p=ardour.git diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index d3b65210a4..c2c21a631d 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -986,8 +986,15 @@ Session::playlist_length_changed () } void -Session::diskstream_playlist_changed (boost::shared_ptr dstream) +Session::diskstream_playlist_changed (boost::weak_ptr wptr) { + boost::shared_ptr dstream = wptr.lock(); + + if (!dstream) { + return; + + } + boost::shared_ptr playlist; if ((playlist = dstream->playlist()) != 0) { @@ -2019,12 +2026,12 @@ Session::add_diskstream (boost::shared_ptr dstream) /* writer goes out of scope, copies ds back to main */ } - dstream->PlaylistChanged.connect (sigc::bind (mem_fun (*this, &Session::diskstream_playlist_changed), dstream)); + dstream->PlaylistChanged.connect (sigc::bind (mem_fun (*this, &Session::diskstream_playlist_changed), + boost::weak_ptr (dstream))); /* this will connect to future changes, and check the current length */ diskstream_playlist_changed (dstream); dstream->prepare (); - } void @@ -2077,6 +2084,8 @@ Session::remove_route (shared_ptr route) boost::shared_ptr d = dsl.get_copy(); d->remove (ds); } + + diskstreams.flush (); } find_current_end (); @@ -2085,8 +2094,9 @@ Session::remove_route (shared_ptr route) set_dirty(); // We need to disconnect the routes inputs and outputs - route->disconnect_inputs(NULL); - route->disconnect_outputs(NULL); + + route->disconnect_inputs (0); + route->disconnect_outputs (0); /* get rid of it from the dead wood collection in the route list manager */