void EGLContext::_destroyInternalResources() { endCurrent(); eglDestroyContext(mEglDisplay, mContext); EGL_CHECK_ERROR mContext = NULL; }
BlackBerryEGLContext::~BlackBerryEGLContext() { GLES2RenderSystem *rs = static_cast<GLES2RenderSystem*>(Root::getSingleton().getRenderSystem()); rs->_unregisterContext(this); if (mGlSurf != EGL_NO_SURFACE ) { eglDestroySurface(mGLDisplay, mEglConf); } if (mContext == eglGetCurrentContext()) { endCurrent(); } if (mContext != NULL) { eglDestroyContext(mGLDisplay, mContext); } eglTerminate(mGLDisplay); }