1. Jason McKesson
  2. gltut

Source

gltut / Tut 01 Hello Triangle / tut1.cpp

Diff from to

File Tut 01 Hello Triangle/tut1.cpp

 
+#include <algorithm>
 #include <string>
 #include <vector>
 #include <stdio.h>
 		delete[] strInfoLog;
 	}
 
+	for(size_t iLoop = 0; iLoop < shaderList.size(); iLoop++)
+		glDetachShader(program, shaderList[iLoop]);
+
 	return program;
 }
 
 	shaderList.push_back(CreateShader(GL_FRAGMENT_SHADER, strFragmentShader));
 
 	theProgram = CreateProgram(shaderList);
+
+	std::for_each(shaderList.begin(), shaderList.end(), glDeleteShader);
 }
 
 const float vertexPositions[] = {