Correctly free memory.
Change-Id: I08fcbfa7d27ae413e0a8e8ca6ea305c8530a72c1
This commit is contained in:
@@ -74,8 +74,8 @@ public:
|
||||
|
||||
~Line() {
|
||||
delete mPatch;
|
||||
delete mXDivs;
|
||||
delete mYDivs;
|
||||
delete[] mXDivs;
|
||||
delete[] mYDivs;
|
||||
|
||||
glDeleteTextures(1, &mTexture);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ Patch::Patch(const uint32_t xCount, const uint32_t yCount) {
|
||||
}
|
||||
|
||||
Patch::~Patch() {
|
||||
delete vertices;
|
||||
delete[] vertices;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -46,10 +46,9 @@ Program::Program(const char* vertex, const char* fragment) {
|
||||
GLint infoLen = 0;
|
||||
glGetProgramiv(id, GL_INFO_LOG_LENGTH, &infoLen);
|
||||
if (infoLen > 1) {
|
||||
char* log = (char*) malloc(sizeof(char) * infoLen);
|
||||
glGetProgramInfoLog(id, infoLen, 0, log);
|
||||
GLchar log[infoLen];
|
||||
glGetProgramInfoLog(id, infoLen, 0, &log[0]);
|
||||
LOGE("Error while linking shaders: %s", log);
|
||||
delete log;
|
||||
}
|
||||
glDeleteShader(vertexShader);
|
||||
glDeleteShader(fragmentShader);
|
||||
|
||||
Reference in New Issue
Block a user