fix: Occasional crash when switching fonts

This commit is contained in:
WerWolv
2025-02-18 21:50:51 +01:00
parent c39ae84922
commit d3c2516f5f
2 changed files with 10 additions and 6 deletions

View File

@@ -65,7 +65,9 @@ namespace hex::fonts {
return;
}
loadFont(widget, name, &font, ImHexApi::System::getGlobalScale() * ImHexApi::System::getBackingScaleFactor());
TaskManager::doLater([&name, &font, &widget] {
loadFont(widget, name, &font, ImHexApi::System::getGlobalScale() * ImHexApi::System::getBackingScaleFactor());
});
});
loadFont(widget.getWidget(), name, &font, ImHexApi::System::getGlobalScale() * ImHexApi::System::getBackingScaleFactor());