brownian:: correct memory clearing

This commit is contained in:
Zeno Rogue 2019-01-11 02:23:00 +01:00
parent d901b1b140
commit 90771dfdbe
1 changed files with 6 additions and 0 deletions

View File

@ -176,6 +176,12 @@ namespace brownian {
colors[4];
}
int hrc = addHook(hooks_removecells, 0, [] () {
vector<cell*> to_remove;
for(auto p: futures) if(is_cell_removed(p.first)) to_remove.push_back(p.first);
for(auto r: to_remove) futures.erase(r);
}) + addHook(clearmemory, 0, [] () { futures.clear(); });
}
namespace westwall {