summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index df79fe3a69..ed3f176393 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -352,8 +352,11 @@ void unit_free(Unit *u) {
SET_FOREACH(t, u->names, i)
hashmap_remove_value(u->manager->units, t, u);
- if (u->job)
- job_free(u->job);
+ if (u->job) {
+ Job *j = u->job;
+ job_uninstall(j);
+ job_free(j);
+ }
for (d = 0; d < _UNIT_DEPENDENCY_MAX; d++)
bidi_set_free(u, u->dependencies[d]);