diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-10 10:12:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-10 10:12:10 +0200 |
commit | 9d576438a1ee932bde1fb0f1be1aa5cae646fd4e (patch) | |
tree | 5a52e553000ce287939f9144fa5ce0926f936e5a /src/core/unit.c | |
parent | 77030bd65f755c10294aec7d3b87febea977b8e9 (diff) |
unit: don't allow units to be gc'ed that still are referenced via UnitRef
Diffstat (limited to 'src/core/unit.c')
-rw-r--r-- | src/core/unit.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index ba4c7d5b32..c9cd9ee2a0 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -258,6 +258,9 @@ bool unit_check_gc(Unit *u) { if (unit_active_state(u) != UNIT_INACTIVE) return true; + if (u->refs) + return true; + if (UNIT_VTABLE(u)->check_gc) if (UNIT_VTABLE(u)->check_gc(u)) return true; |