1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Fix: Removed freed up FontData's dangling data in Advanced and Fallback text server

This commit is contained in:
avnotaklu
2025-05-26 22:38:47 +05:30
parent 6c9765d87e
commit 00beda9691
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);