summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-21 06:01:13 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-21 06:01:13 +0200
commit701cc384c283206a29b21e4e7302e5cf5f2d9433 (patch)
tree0e8e47d12cb3ea47794bad390658c900ed61d691 /job.c
parent48507e6621596b0d5503fad6cd9e0685917603f5 (diff)
manager: automatically GC unreferenced units
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;