mirror of https://github.com/axmolengine/axmol.git
Improve memory use
This commit is contained in:
parent
6d28887126
commit
b897e61c94
|
@ -256,7 +256,7 @@ void ProgramGL::computeUniformInfos()
|
|||
_totalBufferSize = 0;
|
||||
_maxLocation = -1;
|
||||
_activeUniformInfos.clear();
|
||||
GLchar* uniformName = (GLchar*)malloc(MAX_UNIFORM_NAME_LENGTH + 1);
|
||||
GLchar uniformName[MAX_UNIFORM_NAME_LENGTH + 1];
|
||||
for (int i = 0; i < numOfUniforms; ++i)
|
||||
{
|
||||
glGetActiveUniform(_program, i, MAX_UNIFORM_NAME_LENGTH, &length, &uniform.count, &uniform.type, uniformName);
|
||||
|
@ -278,7 +278,6 @@ void ProgramGL::computeUniformInfos()
|
|||
_totalBufferSize += uniform.size * uniform.count;
|
||||
_maxLocation = _maxLocation <= uniform.location ? (uniform.location + 1) : _maxLocation;
|
||||
}
|
||||
free(uniformName);
|
||||
}
|
||||
|
||||
int ProgramGL::getAttributeLocation(Attribute name) const
|
||||
|
|
Loading…
Reference in New Issue