Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Fix leaked JNI local reference in GeckoSurfaceTexture#2772

Merged
bluemarvin merged 1 commit into
masterfrom
surface_leak
Feb 10, 2020
Merged

Fix leaked JNI local reference in GeckoSurfaceTexture#2772
bluemarvin merged 1 commit into
masterfrom
surface_leak

Conversation

@MortimerGoro

Copy link
Copy Markdown
Contributor

I hit a JNI reference overflow when working on exit from WebXR. This happens because exit is not working yet and the ExternalBlitter->cancelFrame() is called every frame, leading to a crash after some seconds.

The leak also happens in WebVR but in a slower pace

@MortimerGoro MortimerGoro changed the title Fix leaked JNI local references in GeckoSurfaceTexture Fix leaked JNI local reference in GeckoSurfaceTexture Feb 10, 2020
@MortimerGoro MortimerGoro self-assigned this Feb 10, 2020
Comment on lines 162 to +163
surface = GeckoSurfaceTexture::Create(aSurfaceHandle);
m.surfaceMap[aSurfaceHandle] = surface;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What condition causes us to have a aSurfaceHandle value with out it being in the m.surfaceMap?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

A new texture that hasn't been used before or StopPresenting() call which cleared the surfaces

@bluemarvin bluemarvin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch.

@bluemarvin bluemarvin merged commit 42892aa into master Feb 10, 2020
@bluemarvin bluemarvin deleted the surface_leak branch February 10, 2020 20:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants