mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-28 11:00:34 +00:00
added missing clearmemory in nonisotropic geometries; this also fixed a crash in Archimedean
This commit is contained in:
parent
123a972261
commit
a25bf14cff
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) {
|
||||
if(!at) return;
|
||||
queue<heptagon*> q;
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user