Skip to content

Commit

Permalink
Fix leaked JNI local references in GeckoSurfaceTexture (#2772)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro committed Feb 10, 2020
1 parent 26417bc commit 42892aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/cpp/ExternalBlitter.cpp
Expand Up @@ -160,6 +160,7 @@ ExternalBlitter::CancelFrame(const int32_t aSurfaceHandle) {
surface = iter->second;
} else {
surface = GeckoSurfaceTexture::Create(aSurfaceHandle);
m.surfaceMap[aSurfaceHandle] = surface;
}

if (surface) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/cpp/GeckoSurfaceTexture.cpp
Expand Up @@ -137,6 +137,7 @@ GeckoSurfaceTexture::Create(const int32_t aHandle) {
}
result = std::make_shared<vrb::ConcreteClass<GeckoSurfaceTexture, GeckoSurfaceTexture::State> >();
result->m.surface = sEnv->NewGlobalRef(surface);
sEnv->DeleteLocalRef(surface);
result->IncrementUse();
return result;
}
Expand Down

0 comments on commit 42892aa

Please sign in to comment.