mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Fixed a minor memory leak caused by certain rare error conditions in love.graphics.newCanvas.
This commit is contained in:
@@ -560,7 +560,9 @@ bool Canvas::loadVolatile()
|
||||
|
||||
if (glGetError() != GL_NO_ERROR)
|
||||
{
|
||||
status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
|
||||
gl.deleteTexture(texture);
|
||||
texture = 0;
|
||||
status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -584,7 +586,14 @@ bool Canvas::loadVolatile()
|
||||
status = strategy->createFBO(fbo, texture);
|
||||
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE)
|
||||
{
|
||||
if (fbo != 0)
|
||||
{
|
||||
strategy->deleteFBO(fbo, 0, 0);
|
||||
fbo = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
clear(Color(0, 0, 0, 0));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user