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:
parent
e9cb5056f1
commit
54af4f1ff7
@ -993,6 +993,11 @@ TrackNodePointer TrackList::Remove(Track *t)
|
|||||||
|
|
||||||
void TrackList::Clear(bool sendEvent)
|
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;
|
ListOfTracks tempList;
|
||||||
tempList.swap( *this );
|
tempList.swap( *this );
|
||||||
if (sendEvent)
|
if (sendEvent)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user