Skip to content

Conversation

@khaledhosny
Copy link
Contributor

Fixes #120

Call removeFunction() for functions added by addFunction(), as well as
calling hb_draw_funcs_destroy() when destroying the font.
It seems that this.blob etc are always null when afterEach callback is
called, so we now use global variables instead.
if (face) face.destroy();
if (font) font.destroy();
if (buffer) buffer.destroy();
blob = face = font = buffer = undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh whoops. Apparently shared context via this only works if the afterEach is defined in a describe. I think I like this fix since it's compatible with the new-ish node:test.

@khaledhosny khaledhosny merged commit 5c28889 into main Apr 6, 2025
1 check passed
@khaledhosny khaledhosny deleted the issue-120 branch April 6, 2025 22:42
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.

Memory increase when using shapeWithTrace

3 participants