summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsContext.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-01-19 16:42:02 -0800
committerMathias Agopian <mathias@google.com>2011-01-19 16:58:10 -0800
commit578b7a2265555655a8a70e8a2d621e906c9c9be0 (patch)
tree63d67a4bffb4b3740d162d1156e47f41df313af3 /libs/rs/rsContext.cpp
parent7a97ad421b50208dc2f484cc23fa3bb29331a713 (diff)
downloadframeworks_base-578b7a2265555655a8a70e8a2d621e906c9c9be0.zip
frameworks_base-578b7a2265555655a8a70e8a2d621e906c9c9be0.tar.gz
frameworks_base-578b7a2265555655a8a70e8a2d621e906c9c9be0.tar.bz2
fix [3367893] Rotating device on YouTube's home screen several times kills system_server
A typo in RS tear down cause caused eglMakeCurrent to fail. Additionnaly, EGLSurfaces where not destroyed explicitely. Everything worked properly when only one RS context was used, as eglTerminate() would clean-up everything. however in the present case, there seem to be more than one RS context and eglTerminate() is not called. Change-Id: I37a10945b9c0a85c4f7abad1c4f4c24bc0daa0a5
Diffstat (limited to 'libs/rs/rsContext.cpp')
-rw-r--r--libs/rs/rsContext.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp
index 2e0c491..98f30ae 100644
--- a/libs/rs/rsContext.cpp
+++ b/libs/rs/rsContext.cpp
@@ -253,7 +253,11 @@ void Context::deinitEGL() {
LOGV("%p, deinitEGL", this);
if (mEGL.mContext != EGL_NO_CONTEXT) {
- eglMakeCurrent(mEGL.mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, mEGL.mContext);
+ eglMakeCurrent(mEGL.mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ eglDestroySurface(mEGL.mDisplay, mEGL.mSurfaceDefault);
+ if (mEGL.mSurface != EGL_NO_SURFACE) {
+ eglDestroySurface(mEGL.mDisplay, mEGL.mSurface);
+ }
eglDestroyContext(mEGL.mDisplay, mEGL.mContext);
checkEglError("eglDestroyContext");
}