diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2012-04-20 10:21:37 +0200 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2012-04-20 17:12:27 +0200 |
commit | 97e7d748d1bf26790fc3b2607885f4ac8c4ecf3a (patch) | |
tree | bbabe2eb9589c28da467ba4e0d510ac7cd65e98f /src/core/unit.c | |
parent | 121b3b318042b7fd67ac96601971c1c2f9b77be5 (diff) |
job: job_uninstall()
Split the uninstallation of the job from job_free() into a separate function.
Adjust the callers.
job_free() now only works on unlinked and uninstalled jobs. This enforces clear
thinking about job lifetimes.
Diffstat (limited to 'src/core/unit.c')
-rw-r--r-- | src/core/unit.c | 7 |
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]); |