releaseProgram method

dynamic releaseProgram(
  1. dynamic program
)

Implementation

releaseProgram(program) {
  if (--program.usedTimes == 0) {
    // Remove from unordered set
    var i = programs.indexOf(program);
    programs[i] = programs[programs.length - 1];
    programs.removeLast();

    // Free WebGL resources
    program.destroy();
  }
}