mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
Fixed a potential memory leak when a Font object errors
This commit is contained in:
@@ -186,7 +186,15 @@ Font::Glyph *Font::addGlyph(uint32 glyph)
|
|||||||
if (textureY + h + TEXTURE_PADDING > textureHeight)
|
if (textureY + h + TEXTURE_PADDING > textureHeight)
|
||||||
{
|
{
|
||||||
// totally out of space - new texture!
|
// totally out of space - new texture!
|
||||||
createTexture();
|
try
|
||||||
|
{
|
||||||
|
createTexture();
|
||||||
|
}
|
||||||
|
catch (love::Exception &)
|
||||||
|
{
|
||||||
|
gd->release();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Glyph *g = new Glyph;
|
Glyph *g = new Glyph;
|
||||||
|
|||||||
Reference in New Issue
Block a user