Skip to content

Fix TrueTypeInterpreter pool state pollution#540

Closed
christianrondeau wants to merge 1 commit into
SixLabors:mainfrom
mediaclip:truetype_pool_leak
Closed

Fix TrueTypeInterpreter pool state pollution#540
christianrondeau wants to merge 1 commit into
SixLabors:mainfrom
mediaclip:truetype_pool_leak

Conversation

@christianrondeau

Copy link
Copy Markdown
Contributor

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

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.

@CLAassistant

CLAassistant commented Jul 3, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@JimBobSquarePants

Copy link
Copy Markdown
Member

Closed, replaced by #541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants