gpu_tonemapper: Free eglImage on termination
Buffers used for gpu tone mapping were getting
leaked as eglImage was not destroyed.
Free eglImage on termination.
Change-Id: I4473bc01efd2d7c8e19b7d3cbcd8330eff591081
Crs-fixed: 1106899
diff --git a/gpu_tonemapper/EGLImageBuffer.cpp b/gpu_tonemapper/EGLImageBuffer.cpp
index e64e16f..3ed236b 100644
--- a/gpu_tonemapper/EGLImageBuffer.cpp
+++ b/gpu_tonemapper/EGLImageBuffer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
@@ -74,6 +74,13 @@
GL(glDeleteFramebuffers(1, &framebufferID));
framebufferID = 0;
}
+
+ // Delete the eglImage
+ if (eglImageID != 0)
+ {
+ eglDestroyImageKHR(eglGetCurrentDisplay(), eglImageID);
+ eglImageID = 0;
+ }
}
//-----------------------------------------------------------------------------