diff options
author | Carl Hetherington <carl@carlh.net> | 2011-05-02 23:22:00 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-05-02 23:22:00 +0000 |
commit | fe2651ae5fd51620396bf26b82de18e1f5626e43 (patch) | |
tree | 9e54ace8c81b40a72478b16ce3219aa4ed30a189 /libs/ardour/session_playlists.cc | |
parent | f89c285bcc6c99fce417da9ebfc9434e2e60314f (diff) |
Remove playlists from the session lists when they DropReferences. Should fix #4023.
git-svn-id: svn://localhost/ardour2/branches/3.0@9460 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_playlists.cc')
-rw-r--r-- | libs/ardour/session_playlists.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index 1e5a276ad4..b4f85aa1a0 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -78,12 +78,24 @@ SessionPlaylists::add (boost::shared_ptr<Playlist> playlist) if (!existing) { playlists.insert (playlists.begin(), playlist); playlist->InUse.connect_same_thread (*this, boost::bind (&SessionPlaylists::track, this, _1, boost::weak_ptr<Playlist>(playlist))); + playlist->DropReferences.connect_same_thread ( + *this, boost::bind (&SessionPlaylists::remove_weak, this, boost::weak_ptr<Playlist> (playlist)) + ); } return existing; } void +SessionPlaylists::remove_weak (boost::weak_ptr<Playlist> playlist) +{ + boost::shared_ptr<Playlist> p = playlist.lock (); + if (p) { + remove (p); + } +} + +void SessionPlaylists::remove (boost::shared_ptr<Playlist> playlist) { Glib::Mutex::Lock lm (lock); |