From 1ddb263d21099ae42195c2bc382bdf72a7f24f82 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 28 Dec 2014 02:44:37 +0100 Subject: machined: don't look for images on each property get, but cache the image object inbetween --- src/machine/machined.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/machine/machined.c') diff --git a/src/machine/machined.c b/src/machine/machined.c index c5c20abf0c..6877c2b313 100644 --- a/src/machine/machined.c +++ b/src/machine/machined.c @@ -34,6 +34,7 @@ #include "bus-util.h" #include "bus-error.h" #include "label.h" +#include "machine-image.h" #include "machined.h" Manager *manager_new(void) { @@ -66,6 +67,7 @@ Manager *manager_new(void) { void manager_free(Manager *m) { Machine *machine; + Image *i; assert(m); @@ -76,6 +78,13 @@ void manager_free(Manager *m) { hashmap_free(m->machine_units); hashmap_free(m->machine_leaders); + while ((i = hashmap_steal_first(m->image_cache))) + image_unref(i); + + hashmap_free(m->image_cache); + + sd_event_source_unref(m->image_cache_defer_event); + bus_verify_polkit_async_registry_free(m->polkit_registry); sd_bus_unref(m->bus); -- cgit v1.2.3-54-g00ecf