1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

rogueviz:: do_cleanup as a separate function

This commit is contained in:
Zeno Rogue 2021-03-31 12:19:31 +02:00
parent 4af75fe611
commit 03f55aa372
2 changed files with 10 additions and 4 deletions

View File

@ -918,6 +918,13 @@ int search_for = -1;
vector<reaction_t> cleanup;
void do_cleanup() {
while(!cleanup.empty()) {
cleanup.back()();
cleanup.pop_back();
}
}
void close() {
search_for = -1;
for(int i=0; i<isize(vdata); i++)
@ -930,10 +937,7 @@ void close() {
anygraph::coords.clear();
callhooks(hooks_close);
edgetypes.clear();
while(!cleanup.empty()) {
cleanup.back()();
cleanup.pop_back();
}
do_cleanup();
relmatrices.clear();
}

View File

@ -98,6 +98,8 @@ namespace rogueviz {
void storeall(int from = 0);
extern vector<reaction_t> cleanup;
void do_cleanup();
template<class T, class U> void rv_hook(hookset<T>& m, int prio, U&& hook) {
int p = addHook(m, prio, hook);