1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 09:20:16 +01:00

Prevent possible dangling pointers to Project from Clipboard

This commit is contained in:
Paul Licameli
2020-07-01 18:16:39 -04:00
parent 8ea07572c1
commit b4ce083185
5 changed files with 16 additions and 12 deletions

View File

@@ -34,7 +34,7 @@ void Clipboard::Clear()
{
mT0 = 0.0;
mT1 = 0.0;
mProject = nullptr;
mProject.reset();
mTracks->Clear();
// Emit an event for listeners
@@ -42,7 +42,7 @@ void Clipboard::Clear()
}
void Clipboard::Assign( TrackList && newContents,
double t0, double t1, AudacityProject *pProject )
double t0, double t1, const std::weak_ptr<AudacityProject> &pProject )
{
newContents.Swap( *mTracks );
newContents.Clear();