Browse Source

fix warning, delete entire array not just first element

master
Odilitime 5 years ago
parent
commit
bd12421697
  1. 6
      src/graphics/opengl/ShaderLoader.cpp

6
src/graphics/opengl/ShaderLoader.cpp

@ -26,7 +26,7 @@ GLuint ShaderLoader::loadShader(const std::string &shaderName, Shader::Type type @@ -26,7 +26,7 @@ GLuint ShaderLoader::loadShader(const std::string &shaderName, Shader::Type type
return 0;
}
int fileSize = file.tellg();
long fileSize = file.tellg();
file.seekg(std::ifstream::beg);
char *buffer = static_cast<char *>(malloc(static_cast<unsigned int>(fileSize) + 1));
file.read(buffer, fileSize);
@ -102,7 +102,7 @@ int ShaderLoader::checkShader(GLuint shader, const std::string &shaderName, Shad @@ -102,7 +102,7 @@ int ShaderLoader::checkShader(GLuint shader, const std::string &shaderName, Shad
glGetShaderInfoLog(shader, logSize, &logSize, log);
logError() << "Shader " << shaderName << " failed to compile. GL log output: "
<< log << std::endl;
delete log;
delete[] log;
glDeleteShader(shader);
return 1;
}
@ -127,7 +127,7 @@ int ShaderLoader::checkProgram(GLuint program, GLenum pname, const std::string & @@ -127,7 +127,7 @@ int ShaderLoader::checkProgram(GLuint program, GLenum pname, const std::string &
glGetProgramInfoLog(program, logSize, &logSize, log);
logError() << "Program with shader1 " << shaderName << " failed to be "
<< getProgramStatusString(pname) << ". GL log output: " << log << std::endl;
delete log;
delete[] log;
glDeleteProgram(program);
return 1;
}

Loading…
Cancel
Save