Fix TrueTypeInterpreter pool state pollution#540
Closed
christianrondeau wants to merge 1 commit into
Closed
Conversation
4 tasks
Member
|
Closed, replaced by #541 |
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.
Prerequisites
Description
Some of our tests were non-deterministic. Fonts drawing would sometimes be different when running under load (here's a repro of the behavior we are seeing: truetype_pool_leak.zip)
It turns out to be caused by the TrueTypeInterpreter pool not fully reinitializing between uses, which has unexpected side effects when rendering different font sizes. Related to #486.
A simpler repro is in the commit's unit tests. Note that I added the state reset in SetControlValueTable because that's where the other Reset\Clear were, but it might be better to put this reset code when pulling an instance out of the pool instead (Reset method called after this.interpreterPool.Get()), could be a refactor if you want. Also note that I'm resetting a bit more than strictly necessary to avoid other potential issues I might have missed.