1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Merge pull request #106833 from avnotaklu/window-scaling-breaking-on-font-data-freed

Remove freed up FontForSize data from `oversampling_levels`
This commit is contained in:
Thaddeus Crews
2025-05-28 09:47:40 -05:00
2 changed files with 12 additions and 0 deletions

View File

@@ -397,6 +397,12 @@ void TextServerAdvanced::_free_rid(const RID &p_rid) {
MutexLock ftlock(ft_mutex);
FontAdvanced *fd = font_owner.get_or_null(p_rid);
for (const KeyValue<Vector2i, FontForSizeAdvanced *> &ffsd : fd->cache) {
OversamplingLevel *ol = oversampling_levels.getptr(ffsd.value->viewport_oversampling);
if (ol != nullptr) {
ol->fonts.erase(ffsd.value);
}
}
{
MutexLock lock(fd->mutex);
font_owner.free(p_rid);

View File

@@ -121,6 +121,12 @@ void TextServerFallback::_free_rid(const RID &p_rid) {
MutexLock ftlock(ft_mutex);
FontFallback *fd = font_owner.get_or_null(p_rid);
for (const KeyValue<Vector2i, FontForSizeFallback *> &ffsd : fd->cache) {
OversamplingLevel *ol = oversampling_levels.getptr(ffsd.value->viewport_oversampling);
if (ol != nullptr) {
ol->fonts.erase(ffsd.value);
}
}
{
MutexLock lock(fd->mutex);
font_owner.free(p_rid);