Skip to content

Release the EGL renderer when a texture view is disposed - #1859

Open
YuriiKruk wants to merge 1 commit into
100mslive:mainfrom
YuriiKruk:egl-release-fix
Open

Release the EGL renderer when a texture view is disposed#1859
YuriiKruk wants to merge 1 commit into
100mslive:mainfrom
YuriiKruk:egl-release-fix

Conversation

@YuriiKruk

Copy link
Copy Markdown

Description

HMSTextureView.disposeTextureView() now releases the EGL renderer. Before this it freed only the drawing surface, so the render thread and the EGL context stayed alive for the lifetime of the process, and every texture view that was built and then removed left one behind.

The renderer field in HMSTextureRenderer is private, so it's read reflectively.

Fixes #1858


Additional context

Verified on a Pixel 6 by repeatedly building and disposing texture views while in a room. Debug build: 114 views created, 114 released, no renderer threads left afterwards. Release build: 81 created, 81 released, none left.

Pre-launch Checklist

  • The Documentation is updated accordingly, or this PR doesn't require it.
  • The ExampleAppChangelog is updated with related tickets, or this PR doesn't require it.
  • I updated/added relevant documentation (doc comments with ///).
  • I listed at least one issue that this PR fixes in the description above.
  • I read and followed the Flutter Style Guide.
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

HMSTextureRenderer.release() frees only the EGL surface, so every disposed HMSTextureView left its HandlerThread and EGL context alive for the process lifetime.
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.

🐛 HMSTextureView leaks a render thread and EGL context every time it's disposed

1 participant