Fix crash due to invalidated shared_ptr, as suggested by Paul

git-svn-id: svn://localhost/ardour2/trunk@2565 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2007-10-23 12:50:25 +00:00
parent 6692898732
commit 20db119cd3

View file

@ -271,11 +271,12 @@ AudioPlaylist::refresh_dependents (boost::shared_ptr<Region> r)
if ((*x)->involves (ar)) {
if (find (updated.begin(), updated.end(), *x) == updated.end()) {
try {
if ((*x)->refresh ()) {
updated.insert (*x);
}
pair<set<boost::shared_ptr<Crossfade> >::iterator, bool> const u = updated.insert (*x);
if (u.second) {
/* x was successfully inserted into the set, so it has not already been updated */
try {
(*x)->refresh ();
}
catch (Crossfade::NoCrossfadeHere& err) {