From 86f7afd44f756cf84011a524e9b8d2d398c1a154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Wed, 8 Jun 2016 14:59:03 +0200 Subject: [PATCH] Android: Fix texture leak. The bug fix in https://codereview.webrtc.org/2033943004 was incomplete, and leaks the texture in the case of texture frames arriving during close. See also the similar bug fixed in https://codereview.webrtc.org/2012773004. BUG=webrtc:5966 R=perkj@webrtc.org, sakal@webrtc.org Review URL: https://codereview.webrtc.org/2044383002 . Cr-Commit-Position: refs/heads/master@{#13067} --- webrtc/api/java/jni/androidvideocapturer_jni.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/webrtc/api/java/jni/androidvideocapturer_jni.cc b/webrtc/api/java/jni/androidvideocapturer_jni.cc index 3ebf3464fb..58f4d741ae 100644 --- a/webrtc/api/java/jni/androidvideocapturer_jni.cc +++ b/webrtc/api/java/jni/androidvideocapturer_jni.cc @@ -261,6 +261,7 @@ void AndroidVideoCapturerJni::OnTextureFrame(int width, rtc::CritScope cs(&capturer_lock_); if (!capturer_) { LOG(LS_WARNING) << "OnTextureFrame() called for closed capturer."; + surface_texture_helper_->ReturnTextureFrame(); return; } int adapted_width;