gpu_tonemapper: Get Current EGL context in Destructor
Need to switch to current egl context before deleting the
program other wise it leads to errors and may not clean up
cleanly on deletion.
Change-Id: Ib4c59511e6aec7c7dd7b27ea26e26b189f9bc87f
Crs-fixed: 1113295
Crs-fixed: 1110936
diff --git a/gpu_tonemapper/Tonemapper.cpp b/gpu_tonemapper/Tonemapper.cpp
index 5f2f974..bb7ba1b 100644
--- a/gpu_tonemapper/Tonemapper.cpp
+++ b/gpu_tonemapper/Tonemapper.cpp
@@ -39,6 +39,7 @@
Tonemapper::~Tonemapper()
//-----------------------------------------------------------------------------
{
+ engine_bind();
engine_deleteInputBuffer(tonemapTexture);
engine_deleteInputBuffer(lutXformTexture);
engine_deleteProgram(programID);