fix: ImHex crashing when no fonts were loaded
This commit is contained in:
parent
e3e117a14e
commit
6163f6c4a0
@ -92,7 +92,9 @@ namespace hex {
|
||||
RequestOpenPopup::unsubscribe(this);
|
||||
|
||||
WorkspaceManager::exportToFile();
|
||||
ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.curr_workspace", WorkspaceManager::getCurrentWorkspace()->first);
|
||||
|
||||
if (auto workspace = WorkspaceManager::getCurrentWorkspace(); workspace != WorkspaceManager::getWorkspaces().end())
|
||||
ContentRegistry::Settings::write("hex.builtin.setting.general", "hex.builtin.setting.general.curr_workspace", workspace->first);
|
||||
|
||||
this->exitImGui();
|
||||
this->exitGLFW();
|
||||
@ -1166,6 +1168,13 @@ namespace hex {
|
||||
|
||||
auto fonts = ImHexApi::Fonts::getFontAtlas();
|
||||
|
||||
if (fonts == nullptr) {
|
||||
fonts = IM_NEW(ImFontAtlas)();
|
||||
|
||||
fonts->AddFontDefault();
|
||||
fonts->Build();
|
||||
}
|
||||
|
||||
// Initialize ImGui and all other ImGui extensions
|
||||
GImGui = ImGui::CreateContext(fonts);
|
||||
GImPlot = ImPlot::CreateContext();
|
||||
|
Loading…
x
Reference in New Issue
Block a user