summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'job.c')
-rw-r--r--job.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/job.c b/job.c
index c1b00714ec..3210bb42c2 100644
--- a/job.c
+++ b/job.c
@@ -58,8 +58,10 @@ void job_free(Job *j) {
if (j->installed) {
bus_job_send_removed_signal(j);
- if (j->unit->meta.job == j)
+ if (j->unit->meta.job == j) {
j->unit->meta.job = NULL;
+ unit_add_to_gc_queue(j->unit);
+ }
hashmap_remove(j->manager->jobs, UINT32_TO_PTR(j->id));
j->installed = false;