Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web:canvaskit] move shaders to UniqueRef; fix minor memory leaks #41172

Merged
merged 1 commit into from Apr 14, 2023

Conversation

yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Apr 13, 2023

Move all classes implementing the Shader interface from ManagedSkiaObject to UniqueRef.

Fix two (probably minor) memory leaks:

  • CkImageShader was leaking intermediate instances of SkShader because those were neither attached to a FinalizationRegistry, nor disposed of explicitly through the dispose() method.
  • CkFragmentShader was leaking SkShader instances because it never called CkFragmentInstance.dispose. Additionally, the CkFragmentInstance class isn't really necessary, because UniqueRef is fully sufficient to manage instances of SkShader objects for fragment shaders.

@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Apr 13, 2023
Copy link
Contributor

@harryterkelsen harryterkelsen left a comment

Choose a reason for hiding this comment

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

LGTM

@yjbanov yjbanov added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 14, 2023
@auto-submit auto-submit bot merged commit 460668f into flutter:main Apr 14, 2023
34 checks passed
zhongwuzw pushed a commit to zhongwuzw/engine that referenced this pull request Apr 14, 2023
…utter#41172)

[web:canvaskit] move shaders to UniqueRef; fix minor memory leaks
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine
Projects
None yet
2 participants