fix: Settings sometimes being reset on shutdown

This commit is contained in:
WerWolv
2024-05-16 19:00:31 +02:00
parent d90a04990b
commit c28522b7ef
4 changed files with 17 additions and 4 deletions

View File

@@ -128,7 +128,10 @@ namespace hex {
}
void store() {
const auto &settingsData = getSettingsData();
if (!s_settings.isValid())
return;
const auto &settingsData = *s_settings;
// During a crash settings can be empty, causing them to be overwritten.
if (settingsData.empty()) {

View File

@@ -216,7 +216,7 @@ namespace hex {
}
void clearSelection() {
impl::s_currentSelection.reset();
impl::s_currentSelection->reset();
}
void setSelection(const Region &region, prv::Provider *provider) {

View File

@@ -134,8 +134,8 @@ namespace hex {
}
void LayoutManager::reset() {
s_layoutPathToLoad.reset();
s_layoutStringToLoad.reset();
s_layoutPathToLoad->reset();
s_layoutStringToLoad->reset();
s_layouts->clear();
}