mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	rulegen:: fix memory leak in add_other_origins
This commit is contained in:
		| @@ -1845,6 +1845,7 @@ void build_test(); | |||||||
| struct hrmap_rulegen : hrmap { | struct hrmap_rulegen : hrmap { | ||||||
|   hrmap *base; |   hrmap *base; | ||||||
|   heptagon *origin; |   heptagon *origin; | ||||||
|  |   vector<heptagon*> extra_origins; | ||||||
|  |  | ||||||
|   heptagon* gen(int s, int d, bool c7) { |   heptagon* gen(int s, int d, bool c7) { | ||||||
|     int t = arb::current.shapes[treestates[s].sid].size(); |     int t = arb::current.shapes[treestates[s].sid].size(); | ||||||
| @@ -1859,6 +1860,7 @@ struct hrmap_rulegen : hrmap { | |||||||
|    |    | ||||||
|   ~hrmap_rulegen() {  |   ~hrmap_rulegen() {  | ||||||
|     clearfrom(origin); |     clearfrom(origin); | ||||||
|  |     for(auto eo: extra_origins) clearfrom(eo); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   hrmap_rulegen() { |   hrmap_rulegen() { | ||||||
| @@ -2035,6 +2037,7 @@ EX void add_other_origins(hrmap *m0) { | |||||||
|     tcell_to_cell[c] = s; |     tcell_to_cell[c] = s; | ||||||
|     c->dist = 0; |     c->dist = 0; | ||||||
|     t_origin.push_back(c); |     t_origin.push_back(c); | ||||||
|  |     m->extra_origins.push_back(extra_origin); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   println(hlog, "t_origin size = ", isize(t_origin)); |   println(hlog, "t_origin size = ", isize(t_origin)); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue