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

Remove the naked new in allocation of AudacityProject

This commit is contained in:
Paul Licameli
2016-08-14 11:41:59 -04:00
parent 3d84c0d17e
commit fe5ab9a462
11 changed files with 100 additions and 56 deletions

View File

@@ -129,9 +129,9 @@ void ODTask::DoSome(float amountWork)
//we did a bit of progress - we should allow a resave.
ODLocker locker{ &AudacityProject::AllProjectDeleteMutex() };
for(unsigned i=0; i<gAudacityProjects.GetCount(); i++)
for(unsigned i=0; i<gAudacityProjects.size(); i++)
{
if(IsTaskAssociatedWithProject(gAudacityProjects[i]))
if(IsTaskAssociatedWithProject(gAudacityProjects[i].get()))
{
//mark the changes so that the project can be resaved.
gAudacityProjects[i]->GetUndoManager()->SetODChangesFlag();
@@ -153,9 +153,9 @@ void ODTask::DoSome(float amountWork)
wxCommandEvent event( EVT_ODTASK_COMPLETE );
ODLocker locker{ &AudacityProject::AllProjectDeleteMutex() };
for(unsigned i=0; i<gAudacityProjects.GetCount(); i++)
for(unsigned i=0; i<gAudacityProjects.size(); i++)
{
if(IsTaskAssociatedWithProject(gAudacityProjects[i]))
if(IsTaskAssociatedWithProject(gAudacityProjects[i].get()))
{
//this assumes tasks are only associated with one project.
gAudacityProjects[i]->GetEventHandler()->AddPendingEvent(event);