Cleaning Up the Application#
In this final stage, an OpenGL ES application must release all the resources that have been allocated to it during initialisation. This ensures there are no resource leaks when the application exits.
This stage mirrors the initialisation stage in reverse and is handled completely in releaseEGLState()
and releaseGLState()
.
The basic steps are shown below.
Cleaning up OpenGL ES objects#
Delete the fragment shader.
Delete the vertex shader.
Delete the shader program.
Delete the vertex buffer.
Cleaning up EGL objects#
Release the EGL context.
Release the EGL display connection.