1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-16 08:34:10 +02:00

More precautions about the back-pointers of tracks to their lists

This commit is contained in:
Paul Licameli 2017-07-14 10:03:11 -04:00
parent e9cb5056f1
commit 54af4f1ff7

View File

@ -993,6 +993,11 @@ TrackNodePointer TrackList::Remove(Track *t)
void TrackList::Clear(bool sendEvent)
{
// Null out the back-pointers in tracks, in case there are outstanding
// shared_ptrs to those tracks.
for ( auto pTrack: *this )
pTrack->SetOwner( {}, {} );
ListOfTracks tempList;
tempList.swap( *this );
if (sendEvent)