Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix a null deref on exit
  • Loading branch information
lavv17 committed Jul 5, 2021
1 parent d67fc14 commit ced8ab2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Job.cc
Expand Up @@ -365,12 +365,15 @@ xstring& Job::FormatJobs(xstring& s,int verbose,int indent)

void Job::BuryDoneJobs()
{
xlist_for_each_safe(Job,all_jobs,node,scan,next)
xarray<Job*> to_bury;
xlist_for_each(Job,all_jobs,node,scan)
{
if((scan->parent==this || scan->parent==0) && scan->jobno>=0
&& scan->Done())
scan->DeleteLater();
to_bury.append(scan);
}
for(int i=0; i<to_bury.count(); i++)
to_bury[i]->DeleteLater();
CollectGarbage();
}

Expand Down
1 change: 1 addition & 0 deletions src/SMTask.cc
Expand Up @@ -129,6 +129,7 @@ void SMTask::DeleteLater()
{
if(deleting)
return;
DEBUG(("DeleteLater(%p) from %p\n",this,current));
deleting=true;
deleted_tasks.add_tail(deleted_tasks_node);
PrepareToDie();
Expand Down

0 comments on commit ced8ab2

Please sign in to comment.