From 6a57987f88039502077607b186e82c42d5ff23fb Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 20 Dec 2016 16:15:45 -0500 Subject: [PATCH] safer use of weak pointer --- src/AudacityApp.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index 1d0cd9bf5..9e26e7261 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -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); } }