Skip to content

Stop binding glyph metrics callbacks to the first GlyphMetrics instance#1841

Open
caolanm wants to merge 1 commit into
adobe-type-tools:developfrom
caolanm:private/caolan/fix_this_in_static
Open

Stop binding glyph metrics callbacks to the first GlyphMetrics instance#1841
caolanm wants to merge 1 commit into
adobe-type-tools:developfrom
caolanm:private/caolan/fix_this_in_static

Conversation

@caolanm

@caolanm caolanm commented Jun 10, 2026

Copy link
Copy Markdown

The function-local static in processGlyphs captures "this" once, so a second conversion in the same process runs the glyph callbacks against the first, already-deleted instance.

Description

seen in a debugging build that issues arise on reusing a this beyond its lifetime

Checklist:

  • [X ] I have followed the Contribution Guidelines
  • I have added test code and data to prove that my code functions correctly
  • I have verified that new and existing tests pass locally with my changes
  • [X ] I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

The function-local static in processGlyphs captures "this" once, so a
second conversion in the same process runs the glyph callbacks against
the first, already-deleted instance.
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.

1 participant