diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2012-04-19 23:20:34 +0200 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2012-04-20 17:12:27 +0200 |
commit | 02a3bcc6b4372ca50c0a62b193f9a75b988ffa69 (patch) | |
tree | e570c8bed3b05d55efc6a0a4d1ac5fe9f876d61d /src/core/job.c | |
parent | 153bda8f03c670caf137f745350c0215b9be2147 (diff) |
job: allow job_free() only on already unlinked jobs
job_free() is IMO too helpful when it unlinks the job from the transaction.
The callers should ensure the job is already unlinked before freeing.
The added assertions check if anyone gets it wrong.
Diffstat (limited to 'src/core/job.c')
-rw-r--r-- | src/core/job.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/job.c b/src/core/job.c index f3c76d66b5..5ea717eae1 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -71,8 +71,10 @@ void job_free(Job *j) { j->installed = false; } - /* Detach from next 'smaller' objects */ - manager_transaction_unlink_job(j->manager, j, true); + assert(!j->transaction_prev); + assert(!j->transaction_next); + assert(!j->subject_list); + assert(!j->object_list); if (j->in_run_queue) LIST_REMOVE(Job, run_queue, j->manager->run_queue, j); |