diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-12-28 02:44:37 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-12-28 02:44:37 +0100 |
commit | 1ddb263d21099ae42195c2bc382bdf72a7f24f82 (patch) | |
tree | 5dacc98baedd786030704379bb7e65e77ff92391 /src/machine/machined.c | |
parent | 3b9c7d955da357a45c0bcd03397160153539bc57 (diff) |
machined: don't look for images on each property get, but cache the image object inbetween
Diffstat (limited to 'src/machine/machined.c')
-rw-r--r-- | src/machine/machined.c | 9 |
1 files changed, 9 insertions, 0 deletions
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); |