diff options
Diffstat (limited to 'src/unit.c')
-rw-r--r-- | src/unit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/unit.c b/src/unit.c index c08091942e..695044a77f 100644 --- a/src/unit.c +++ b/src/unit.c @@ -319,6 +319,10 @@ void unit_free(Unit *u) { bus_unit_send_removed_signal(u); + if (u->meta.load_state != UNIT_STUB) + if (UNIT_VTABLE(u)->done) + UNIT_VTABLE(u)->done(u); + /* Detach from next 'bigger' objects */ SET_FOREACH(t, u->meta.names, i) hashmap_remove_value(u->meta.manager->units, t, u); @@ -344,10 +348,6 @@ void unit_free(Unit *u) { if (u->meta.job) job_free(u->meta.job); - if (u->meta.load_state != UNIT_STUB) - if (UNIT_VTABLE(u)->done) - UNIT_VTABLE(u)->done(u); - cgroup_bonding_free_list(u->meta.cgroup_bondings); for (d = 0; d < _UNIT_DEPENDENCY_MAX; d++) |