]> mj.ucw.cz Git - leo.git/commitdiff
style_results are freed after use
authorMartin Mares <mj@ucw.cz>
Sun, 7 Jun 2015 15:41:06 +0000 (17:41 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 7 Jun 2015 15:41:06 +0000 (17:41 +0200)
map.c
style.c
style.h

diff --git a/map.c b/map.c
index 3dbf7194b3b79468088bf8bb12eeaeb729999fa6..5279d3748f964990301e7084416365fa59dbaf38 100644 (file)
--- 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 d82c71213edb10571bdf9454a85937862cb77f59..b2a342ac267bf3ece60b0dc95b557ad3bfbc9d3d 100644 (file)
--- 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 fb1ff8d1a9471aa9f64b981d7277a4a7c8ecf12b..8abeb84efbbec6da175d9e64bbf70db9334beccf 100644 (file)
--- 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);