Skip to content

Conversation

@michaldobrodenka
Copy link
Contributor

Extension public static Blob ToHarfBuzzBlob(this SKStreamAsset asset) may leak when asset MemoryBase is not IntPtr.Zero.

After freeing memory, Dispose to SKStreamAsset (SKNativeObject) is added.

Bugs Fixed

Behavioral Changes

None.

Required skia PR

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Merged related skia PRs
  • Changes adhere to coding standard
  • Updated documentation

@michaldobrodenka
Copy link
Contributor Author

michaldobrodenka commented Oct 3, 2025 via email

@michaldobrodenka
Copy link
Contributor Author

Fixes #3378

@molesmoke
Copy link

molesmoke commented Oct 6, 2025

It is kind of odd that SKStreamAsset is disposed on one path but not the other (and the caller doesn't know which). My two cents is that the problem is more that SKShaper doesn't dispose the intermediate SKStreamAsset from the Typeface. The leaking stream could already have been destroyed by the time the constructor exits (assuming that the Font no longer requires access to the Blob - since it's written that way already).

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants