1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-18 00:50:52 +02:00

safer use of weak pointer

This commit is contained in:
Paul Licameli 2016-12-20 16:15:45 -05:00
parent 509f974dfb
commit 6a57987f88

View File

@ -914,13 +914,12 @@ void AudacityApp::OnTimer(wxTimerEvent& WXUNUSED(event))
// find which project owns the blockfile
// note: there may be more than 1, but just go with the first one.
//size_t numProjects = gAudacityProjects.size();
AudacityProject *offendingProject {};
AProjectHolder offendingProject;
wxString missingFileName;
{
ODLocker locker { &m_LastMissingBlockFileLock };
offendingProject =
AProjectHolder{ m_LastMissingBlockFileProject }.get();
offendingProject = m_LastMissingBlockFileProject.lock();
missingFileName = m_LastMissingBlockFilePath;
}
@ -944,7 +943,7 @@ locations of the missing files."), missingFileName.c_str());
if (offendingProject->GetMissingAliasFileDialog()) {
offendingProject->GetMissingAliasFileDialog()->Raise();
} else {
ShowAliasMissingDialog(offendingProject, _("Files Missing"),
ShowAliasMissingDialog(offendingProject.get(), _("Files Missing"),
errorMessage, wxT(""), true);
}
}