impr: Significantly reduce memory usage

This commit is contained in:
WerWolv
2025-08-12 18:00:47 +02:00
parent b5a3a8b4c2
commit 6febe9982b
5 changed files with 13 additions and 25 deletions

View File

@@ -17,6 +17,7 @@
#include <clocale>
#include <sstream>
#include <hex/helpers/auto_reset.hpp>
#if defined(OS_WINDOWS)
#include <windows.h>
@@ -660,9 +661,9 @@ namespace hex {
return s_fileToOpen;
}
static std::map<std::fs::path, std::string> s_fonts;
static AutoReset<std::map<std::fs::path, std::string>> s_fonts;
extern "C" void registerFont(const char *fontName, const char *fontPath) {
s_fonts.emplace(fontPath, fontName);
s_fonts->emplace(fontPath, fontName);
}
const std::map<std::fs::path, std::string>& getFonts() {