Closed AlexEne closed 10 years ago
Thanks! I fixed the issues =)
You made a small mistake here:
char* compilationLog = new char[length]; [...] delete compilationLog;
This should be delete[] since it was allocated with was new [].
Oww... You're right. Thanks! =)
From ShaderManager.cpp:
GLsizei* length = new GLsizei; //new is not needed. just GLsizei length = 0; is ok then you just pass it's address in the function below It's not an array. It's just a value. You can use it like this: glGetShaderiv(shaderID, GL_INFO_LOG_LENGTH, &length); char* compilationLog = new char[length];
glGetShaderInfoLog(shaderID, length, NULL, compilationLog);
throw std::exception(([...]+std::string(compilationLog)).c_str()); //Throwing here means you never deallocate compilationLog ( and never deallocate "length" from the original code )