Chromium Code Reviews
DescriptionFix JNI reference leak in MediaCodecVideoEncoder
We currently leak one local reference to MediaCodecVideoEncoder in
every call to MediaCodecVideoEncoderFactory::CreateVideoEncoder. After
the encoder has been re-initialized 512 times, JNI will crash due to
local reference table overflow (max=512).
The actual leak is in the member initializer list of
MediaCodecVideoEncoder. This CL fixes the leak by adding a
ScopedLocalRefFrame outside of the ctor. All JNI code that originate
from a C++ thread (i.e. the entry point is not a Java thread) must use
a ScopedLocalRefFrame in order to avoid leaking local references.
BUG=webrtc:6969
,b/34056152
Review-Url: https://codereview.webrtc.org/2627973004
Cr-Commit-Position: refs/heads/master@{#16034}
Committed: https://chromium.googlesource.com/external/webrtc/+/b66129a27efd44198e4a73a27268ae17032bb617
Patch Set 1 #
Messages
Total messages: 14 (10 generated)
|
|||||||||||||||||||