summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-10 10:12:10 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-10 10:12:10 +0200
commit9d576438a1ee932bde1fb0f1be1aa5cae646fd4e (patch)
tree5a52e553000ce287939f9144fa5ce0926f936e5a /src/core
parent77030bd65f755c10294aec7d3b87febea977b8e9 (diff)
unit: don't allow units to be gc'ed that still are referenced via UnitRef
Diffstat (limited to 'src/core')
-rw-r--r--src/core/unit.c3
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;