mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	added missing clearmemory in nonisotropic geometries; this also fixed a crash in Archimedean
This commit is contained in:
		
							
								
								
									
										5
									
								
								cell.cpp
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								cell.cpp
									
									
									
									
									
								
							| @@ -345,6 +345,11 @@ void unlink_cdata(heptagon *h) { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | EX void clear_heptagon(heptagon *at) { | ||||||
|  |   clearHexes(at); | ||||||
|  |   tailored_delete(at); | ||||||
|  |   } | ||||||
|  |  | ||||||
| EX void clearfrom(heptagon *at) { | EX void clearfrom(heptagon *at) { | ||||||
|   if(!at) return; |   if(!at) return; | ||||||
|   queue<heptagon*> q; |   queue<heptagon*> q; | ||||||
|   | |||||||
| @@ -213,6 +213,7 @@ EX namespace solv { | |||||||
|  |  | ||||||
|     ~hrmap_sol() { |     ~hrmap_sol() { | ||||||
|       delete binary_map; |       delete binary_map; | ||||||
|  |       for(auto& p: at) clear_heptagon(p.second); | ||||||
|       } |       } | ||||||
|      |      | ||||||
|     transmatrix adjmatrix(int i, int j) { |     transmatrix adjmatrix(int i, int j) { | ||||||
| @@ -472,6 +473,10 @@ EX namespace nilv { | |||||||
|      |      | ||||||
|     heptagon *getOrigin() override { return get_at(mvec_zero); } |     heptagon *getOrigin() override { return get_at(mvec_zero); } | ||||||
|      |      | ||||||
|  |     ~hrmap_nil() { | ||||||
|  |       for(auto& p: at) clear_heptagon(p.second); | ||||||
|  |       } | ||||||
|  |  | ||||||
|     heptagon *get_at(mvec c) { |     heptagon *get_at(mvec c) { | ||||||
|       auto& h = at[c]; |       auto& h = at[c]; | ||||||
|       if(h) return h; |       if(h) return h; | ||||||
| @@ -601,6 +606,12 @@ EX namespace product { | |||||||
|    |    | ||||||
|     hrmap_product() { |     hrmap_product() { | ||||||
|       in_underlying([this] { initcells(); underlying_map = currentmap; }); |       in_underlying([this] { initcells(); underlying_map = currentmap; }); | ||||||
|  |       for(hrmap*& m: allmaps) if(m == underlying_map) m = NULL; | ||||||
|  |       } | ||||||
|  |      | ||||||
|  |     ~hrmap_product() { | ||||||
|  |       in_underlying([this] { delete currentmap; }); | ||||||
|  |       for(auto& p: at) tailored_delete(p.second); | ||||||
|       } |       } | ||||||
|    |    | ||||||
|     void draw() override { |     void draw() override { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue