fix: Crash when restarting ImHex more than once

This commit is contained in:
WerWolv
2024-02-19 22:06:46 +01:00
parent 218946d5de
commit adc51d3773
5 changed files with 42 additions and 15 deletions

View File

@@ -471,6 +471,16 @@ namespace hex {
return s_windowResizable;
}
static std::vector<AutoResetBase*> s_autoResetObjects;
void addAutoResetObject(AutoResetBase *object) {
s_autoResetObjects.emplace_back(object);
}
void cleanup() {
for (const auto &object : s_autoResetObjects)
object->reset();
}
}