Commits

Jason McKesson  committed aa47c45

Issue 64: Unreachable code fix

  • Participants
  • Parent commits 90cf532

Comments (0)

Files changed (1)

File framework/framework.cpp

 	{
 		try
 		{
-			return glutil::LinkProgram(shaderList);
+			GLuint prog = glutil::LinkProgram(shaderList);
+			std::for_each(shaderList.begin(), shaderList.end(), glDeleteShader);
+			return prog;
 		}
 		catch(std::exception &e)
 		{
+			std::for_each(shaderList.begin(), shaderList.end(), glDeleteShader);
 			fprintf(stderr, "%s\n", e.what());
 			throw;
 		}
-
-		std::for_each(shaderList.begin(), shaderList.end(), glDeleteShader);
 	}
 
 	float DegToRad(float fAngDeg)