Repository navigation
Fix TextEdit font cache invalidation when font resources change - #125717
Open
huanxiangxingyun wants to merge 5 commits into
Open
huanxiangxingyun wants to merge 5 commits into
huanxiangxingyun wants to merge 5 commits into
Conversation
Comment on lines
+10230
to
+10231
| observed_font->disconnect_changed( | ||
| callable_mp(this, &TextEdit::_font_changed)); |
Member
There was a problem hiding this comment.
Unnecessary, signals are disconnected on deletion
Contributor
Author
There was a problem hiding this comment.
Removed the redundant disconnection in the destructor. Thanks!
Line break optimization Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Line break optimization Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
kitbdev
reviewed
Nov 23, 2026
| Array st_args; | ||
|
|
||
| void _clear(); | ||
| Ref<Font> observed_font; |
Contributor
There was a problem hiding this comment.
Instead of adding this, could we add a getter for the font that is in text and use that instead?
Contributor
Author
There was a problem hiding this comment.
Thank you for your review comments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem(s) does this PR solve?
Additional information
This issue falls into the same category of font cache invalidation problems as the one I previously addressed. While the root causes differ, in this specific case,
TextEditdetermines whether to update its cache by checking if the font resource objects are identical; however, whenFontVariation.base_fontchanges, the external object itself remains the same. Consequently, the stale glyph cache continues to reference font resource IDs (RIDs) that have already been released.The solution in this PR involves listening for the "changed" signal emitted by the font resource, ensuring that the text cache is explicitly invalidated whenever the internal content of the font changes.