egl/android: Remove our own reference to buffers.
authorLepton Wu <lepton@chromium.org>
Tue, 17 Sep 2019 20:49:17 +0000 (13:49 -0700)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 21 Oct 2019 07:50:31 +0000 (07:50 +0000)
commitf4ba31ff504489b7195c83fa8703ba091406d808
tree28c63d3dc860e9a2f73ff4d6de2c90435362ef7b
parentb72205a4c1411881985d29a1e137a91a214f5f20
egl/android: Remove our own reference to buffers.

We currently doesn't maintain it correctly and the buffer gets leaked if
surface is destroyed before calling swapping buffers.

From Android frameworks/native/libs/nativewindow/include/system/window.h:

  The window holds a reference to the buffer between dequeueBuffer and
  either queueBuffer or cancelBuffer, so clients only need their own
  reference if they might use the buffer after queueing or canceling it.

v2: Remove our own reference.

Fixes: 0212db35040 ("egl/android: Cancel any outstanding ANativeBuffer in surface destructor")
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> (v1)
Reviewed-By: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
src/egl/drivers/dri2/platform_android.c