aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWeilun Du <wdu@google.com>2018-09-02 22:46:24 -0700
committerLingfeng Yang <lfy@google.com>2018-09-21 11:46:25 -0700
commitd2cb44dc2a65f35b786dc77160eb3dc16fcff3d6 (patch)
tree0a87bfa4fbe262eb7cd03ee83805a13da6656dd7
parent1b4bcf1ec7d564d4fdab92025f8f7ccd021dd0c9 (diff)
downloaddevice_generic_goldfish-opengl-d2cb44dc2a65f35b786dc77160eb3dc16fcff3d6.tar.gz
device_generic_goldfish-opengl-d2cb44dc2a65f35b786dc77160eb3dc16fcff3d6.tar.bz2
device_generic_goldfish-opengl-d2cb44dc2a65f35b786dc77160eb3dc16fcff3d6.zip
Fixed the bug where egl_surface_t is not deleted
This bug results in egl_surface_t objects in guest not being destroyed properly and therefore increased memory usage. Test: run cts -m "CtsOpenGLTestCases" -t "android.opengl.cts.WrapperTest#testThreadCleanup" should not increase memory usage significantly (e.g 1GB). BUG: 111076027 Change-Id: I297d6d89fcf990410cf559132af8127026354d63 Signed-off-by: Weilun Du <wdu@google.com> (cherry picked from commit 1c9b30150c5d5c36777a11d4b7c0c2d09c281f74)
-rw-r--r--system/egl/egl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/system/egl/egl.cpp b/system/egl/egl.cpp
index 47742f9d..606bf29b 100644
--- a/system/egl/egl.cpp
+++ b/system/egl/egl.cpp
@@ -620,7 +620,10 @@ egl_pbuffer_surface_t::~egl_pbuffer_surface_t()
// Destroy a pending surface and set it to NULL.
static void s_destroyPendingSurfaceAndSetNull(EGLSurface* surface) {
- if (!s_display.isSurface(surface)) {
+ if (!surface)
+ return;
+
+ if (!s_display.isSurface(*surface)) {
*surface = NULL;
return;
}