chiark / gitweb /
unit: don't gc units that are still in STUB state
[elogind.git] / src / unit.c
index 1959b1b940074d0ff23dd81ed3be72d511814f6a..374d2e133106def502cca34b9e24f364af1d9cdd 100644 (file)
@@ -213,6 +213,9 @@ int unit_set_description(Unit *u, const char *description) {
 bool unit_check_gc(Unit *u) {
         assert(u);
 
+        if (u->meta.load_state == UNIT_STUB)
+                return true;
+
         if (UNIT_VTABLE(u)->no_gc)
                 return true;