added missing clearmemory in nonisotropic geometries; this also fixed a crash in Archimedean

This commit is contained in:
Zeno Rogue 2019-08-19 11:27:30 +02:00
parent 123a972261
commit a25bf14cff
2 changed files with 16 additions and 0 deletions

View File

@ -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) {
if(!at) return;
queue<heptagon*> q;

View File

@ -213,6 +213,7 @@ EX namespace solv {
~hrmap_sol() {
delete binary_map;
for(auto& p: at) clear_heptagon(p.second);
}
transmatrix adjmatrix(int i, int j) {
@ -472,6 +473,10 @@ EX namespace nilv {
heptagon *getOrigin() override { return get_at(mvec_zero); }
~hrmap_nil() {
for(auto& p: at) clear_heptagon(p.second);
}
heptagon *get_at(mvec c) {
auto& h = at[c];
if(h) return h;
@ -601,6 +606,12 @@ EX namespace product {
hrmap_product() {
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 {