Skip to content

Commit

Permalink
add missing cleanups on full atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
yairchu committed Jan 12, 2017
1 parent 44f477a commit b7263e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions texture-font.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ texture_font_load_glyph( texture_font_t * self,
if ( region.x < 0 )
{
fprintf( stderr, "Texture atlas is full (line %d)\n", __LINE__ );
FT_Done_Face( face );
FT_Done_FreeType( library );
return NULL;
}
texture_atlas_set_region( self->atlas, region.x, region.y, 4, 4, data, 0 );
Expand Down Expand Up @@ -581,6 +583,8 @@ texture_font_load_glyph( texture_font_t * self,
if ( region.x < 0 )
{
fprintf( stderr, "Texture atlas is full (line %d)\n", __LINE__ );
FT_Done_Face( face );
FT_Done_FreeType( library );
return 0;
}

Expand Down

0 comments on commit b7263e5

Please sign in to comment.