1
0
mirror of synced 2025-02-25 22:08:34 +01:00

fix: Properly clear all global registries

This commit is contained in:
WerWolv 2023-06-30 13:40:16 +02:00
parent bc98556897
commit f9909dab98
3 changed files with 9 additions and 8 deletions

View File

@ -460,7 +460,7 @@ namespace hex {
* @brief Gets the current custom font path * @brief Gets the current custom font path
* @return The current custom font path * @return The current custom font path
*/ */
const std::filesystem::path &getCustomFontPath(); std::filesystem::path &getCustomFontPath();
/** /**
* @brief Gets the current font size * @brief Gets the current font size
@ -486,7 +486,7 @@ namespace hex {
* @brief Gets the currently set additional folder paths * @brief Gets the currently set additional folder paths
* @return The currently set additional folder paths * @return The currently set additional folder paths
*/ */
const std::vector<std::filesystem::path> &getAdditionalFolderPaths(); std::vector<std::filesystem::path> &getAdditionalFolderPaths();
/** /**
* @brief Sets the additional folder paths * @brief Sets the additional folder paths

View File

@ -480,7 +480,7 @@ namespace hex {
return initArgs; return initArgs;
} }
const std::fs::path &getCustomFontPath() { std::fs::path &getCustomFontPath() {
return impl::s_customFontPath; return impl::s_customFontPath;
} }
@ -504,13 +504,13 @@ namespace hex {
} }
static std::vector<std::fs::path> s_additionalFolderPaths; std::vector<std::fs::path> &getAdditionalFolderPaths() {
const std::vector<std::fs::path> &getAdditionalFolderPaths() { static std::vector<std::fs::path> additionalFolderPaths;
return s_additionalFolderPaths; return additionalFolderPaths;
} }
void setAdditionalFolderPaths(const std::vector<std::fs::path> &paths) { void setAdditionalFolderPaths(const std::vector<std::fs::path> &paths) {
s_additionalFolderPaths = paths; getAdditionalFolderPaths() = paths;
} }

View File

@ -325,6 +325,8 @@ namespace hex::init {
ImHexApi::HexEditor::impl::getForegroundHighlightingFunctions().clear(); ImHexApi::HexEditor::impl::getForegroundHighlightingFunctions().clear();
ImHexApi::HexEditor::impl::getTooltips().clear(); ImHexApi::HexEditor::impl::getTooltips().clear();
ImHexApi::HexEditor::impl::getTooltipFunctions().clear(); ImHexApi::HexEditor::impl::getTooltipFunctions().clear();
ImHexApi::System::getAdditionalFolderPaths().clear();
ImHexApi::System::getCustomFontPath().clear();
ContentRegistry::Settings::impl::getEntries().clear(); ContentRegistry::Settings::impl::getEntries().clear();
ContentRegistry::Settings::impl::getSettingsData().clear(); ContentRegistry::Settings::impl::getSettingsData().clear();
@ -375,7 +377,6 @@ namespace hex::init {
ThemeManager::reset(); ThemeManager::reset();
ProjectFile::getHandlers().clear(); ProjectFile::getHandlers().clear();
ProjectFile::getProviderHandlers().clear(); ProjectFile::getProviderHandlers().clear();
ProjectFile::setProjectFunctions(nullptr, nullptr); ProjectFile::setProjectFunctions(nullptr, nullptr);