fix: ImHex should crash less often now when exiting

This commit is contained in:
WerWolv
2021-07-31 17:11:10 +02:00
parent e8d77f8269
commit d345508195
5 changed files with 47 additions and 3 deletions

View File

@@ -10,14 +10,19 @@ namespace hex {
/* Settings */
void ContentRegistry::Settings::load() {
bool loaded = false;
for (const auto &dir : hex::getPath(ImHexPath::Config)) {
std::ifstream settingsFile(dir + "/settings.json");
if (settingsFile.good()) {
settingsFile >> getSettingsData();
loaded = true;
break;
}
}
if (!loaded)
ContentRegistry::Settings::store();
}
void ContentRegistry::Settings::store() {

View File

@@ -2,7 +2,7 @@
namespace hex {
std::map<void*, EventManager::EventList::iterator> EventManager::s_tokenStore;
EventManager::EventList EventManager::s_events;
std::map<void*, EventManager::EventList::iterator> EventManager::s_tokenStore;
}