summaryrefslogtreecommitdiff
path: root/src/machine/machined.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-08-06 16:13:22 +0200
committerDaniel Mack <github@zonque.org>2015-08-06 16:13:22 +0200
commit3996b5251ddfcbe0809d1116821f003f2bca45ef (patch)
treecd362f9d5068d9c21fa1fa26b9d772f7bf2fdd85 /src/machine/machined.c
parentcedafc8a7203c788cc45ecaa26935428a7553544 (diff)
parent49f3fffd94591bdf2bd6c2233a9300daeab79566 (diff)
Merge pull request #898 from poettering/machined-fix-reload
Fix for #376, plus some other fixes
Diffstat (limited to 'src/machine/machined.c')
-rw-r--r--src/machine/machined.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/machine/machined.c b/src/machine/machined.c
index 9bfe2add54..1eeeaf17a5 100644
--- a/src/machine/machined.c
+++ b/src/machine/machined.c
@@ -247,8 +247,16 @@ void manager_gc(Manager *m, bool drop_not_started) {
LIST_REMOVE(gc_queue, m->machine_gc_queue, machine);
machine->in_gc_queue = false;
- if (!machine_check_gc(machine, drop_not_started)) {
+ /* First, if we are not closing yet, initiate stopping */
+ if (!machine_check_gc(machine, drop_not_started) &&
+ machine_get_state(machine) != MACHINE_CLOSING)
machine_stop(machine);
+
+ /* Now, the stop stop probably made this referenced
+ * again, but if it didn't, then it's time to let it
+ * go entirely. */
+ if (!machine_check_gc(machine, drop_not_started)) {
+ machine_finalize(machine);
machine_free(machine);
}
}