From 74d296f7140bcd0b4babe6fe5c06e52e9ffa3f28 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 7 Jun 2015 17:41:06 +0200 Subject: [PATCH] style_results are freed after use --- map.c | 2 +- style.c | 5 +++++ style.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/map.c b/map.c index 3dbf719..5279d37 100644 --- a/map.c +++ b/map.c @@ -352,5 +352,5 @@ void map_apply_styles(struct svg *svg) } } - // FIXME: Ought to destroy the style_results + style_cleanup(&r); } diff --git a/style.c b/style.c index d82c712..b2a342a 100644 --- a/style.c +++ b/style.c @@ -64,6 +64,11 @@ void style_init(struct style_results *r) r->active_layers = mp_alloc_zero(r->pool, r->num_layers * sizeof(layer_t)); } +void style_cleanup(struct style_results *r) +{ + mp_delete(r->pool); +} + void style_begin(struct style_results *r, struct osm_object *o) { ASSERT(!r->num_active_layers); diff --git a/style.h b/style.h index fb1ff8d..8abeb84 100644 --- a/style.h +++ b/style.h @@ -65,6 +65,7 @@ enum prop_keys { // Well-known properties void styles_init(void); void style_init(struct style_results *r); +void style_cleanup(struct style_results *r); void style_begin(struct style_results *r, struct osm_object *o); void style_end(struct style_results *r); -- 2.39.5