mirror of https://github.com/axmolengine/axmol.git
fix memory leak & correct indent
This commit is contained in:
parent
5fd1bc7da7
commit
61b14bf86c
|
@ -332,11 +332,13 @@ void Texture2DGL::getBytes(std::size_t x, std::size_t y, std::size_t width, std:
|
|||
}
|
||||
callback(flippedImage, width, height);
|
||||
CC_SAFE_DELETE_ARRAY(flippedImage);
|
||||
} else
|
||||
{
|
||||
callback(image, width, height);
|
||||
CC_SAFE_DELETE_ARRAY(image);
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(image, width, height);
|
||||
}
|
||||
|
||||
CC_SAFE_DELETE_ARRAY(image);
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO);
|
||||
glDeleteFramebuffers(1, &frameBuffer);
|
||||
|
@ -425,11 +427,12 @@ void TextureCubeGL::getBytes(std::size_t x, std::size_t y, std::size_t width, st
|
|||
}
|
||||
callback(flippedImage, width, height);
|
||||
CC_SAFE_DELETE_ARRAY(flippedImage);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(image, width, height);
|
||||
CC_SAFE_DELETE_ARRAY(image);
|
||||
}
|
||||
CC_SAFE_DELETE_ARRAY(image);
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO);
|
||||
glDeleteFramebuffers(1, &frameBuffer);
|
||||
|
|
Loading…
Reference in New Issue