job: Add job_delete()

This moves freeing the Job object and its fields from block_job_unref()
to job_delete().

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
This commit is contained in:
Kevin Wolf 2018-04-12 19:06:53 +02:00
parent 252291eaea
commit fd61a701f1
3 changed files with 10 additions and 2 deletions

View file

@ -261,9 +261,8 @@ void block_job_unref(BlockJob *job)
block_job_detach_aio_context, job);
blk_unref(job->blk);
error_free(job->blocker);
g_free(job->job.id);
assert(!timer_pending(&job->sleep_timer));
g_free(job);
job_delete(&job->job);
}
}