summaryrefslogtreecommitdiff
path: root/src/core/cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/cgroup.c')
-rw-r--r--src/core/cgroup.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 1c818ab300..cdccf3ff15 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -733,8 +733,12 @@ int manager_notify_cgroup_empty(Manager *m, const char *cgroup) {
return 0;
u = manager_get_unit_by_cgroup(m, cgroup);
- if (u && UNIT_VTABLE(u)->notify_cgroup_empty)
- UNIT_VTABLE(u)->notify_cgroup_empty(u);
+ if (u) {
+ if (UNIT_VTABLE(u)->notify_cgroup_empty)
+ UNIT_VTABLE(u)->notify_cgroup_empty(u);
+
+ unit_add_to_gc_queue(u);
+ }
return 0;
}