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#

  1. Delete the fragment shader.

  2. Delete the vertex shader.

  3. Delete the shader program.

  4. Delete the vertex buffer.

Cleaning up EGL objects#

  1. Release the EGL context.

  2. Release the EGL display connection.