Correctly free memory.

Change-Id: I08fcbfa7d27ae413e0a8e8ca6ea305c8530a72c1
This commit is contained in:
Romain Guy
2010-09-17 10:26:31 -07:00
parent a977120681
commit 31529ff791
3 changed files with 5 additions and 6 deletions

View File

@@ -74,8 +74,8 @@ public:
~Line() {
delete mPatch;
delete mXDivs;
delete mYDivs;
delete[] mXDivs;
delete[] mYDivs;
glDeleteTextures(1, &mTexture);
}

View File

@@ -34,7 +34,7 @@ Patch::Patch(const uint32_t xCount, const uint32_t yCount) {
}
Patch::~Patch() {
delete vertices;
delete[] vertices;
}
///////////////////////////////////////////////////////////////////////////////

View File

@@ -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);