cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.

Home Page:https://www.cocos.com/en/cocos2d-x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory leak in ShaderModuleGL::getErrorLog()

Xrysnow opened this issue · comments

char* ShaderModuleGL::getErrorLog(GLuint shader) const
{
GLint logLength = 0;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength);
char* log = (char*)malloc(sizeof(char) * logLength);
glGetShaderInfoLog(shader, logLength, nullptr, log);
return log;
}

log is never freed.