mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-06 11:32:49 +00:00
rulegen:: fix memory leak in add_other_origins
This commit is contained in:
parent
f3d7601c88
commit
ea9936c544
@ -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();
|
||||||
@ -1858,7 +1859,8 @@ 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));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user