From: Martin Mares Date: Sun, 7 Jun 2015 15:41:06 +0000 (+0200) Subject: style_results are freed after use X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=74d296f7140bcd0b4babe6fe5c06e52e9ffa3f28;p=leo.git style_results are freed after use --- 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);