Skip to content

Commit

Permalink
Font: fix memory leak when using stbtt (#3100)
Browse files Browse the repository at this point in the history
If HAVE_FREETYPE macro is not defined, the memory allocated in buffer is not freed
  • Loading branch information
roiqd03 authored May 9, 2024
1 parent f122cb2 commit 73f856f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Components/Overlay/src/OgreFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,13 @@ namespace Ogre
// Advance a column
if(width)
l += (width + char_spacer);

#ifndef HAVE_FREETYPE
if (buffer != NULL)
{
STBTT_free(buffer, font.userdata);
}
#endif
}
}
#ifdef HAVE_FREETYPE
Expand Down

0 comments on commit 73f856f

Please sign in to comment.