Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - cesarizu

Pages: [1]
1
Graphics / Re: Memory Leak on Font::loadGlyph
« on: November 13, 2016, 06:15:14 am »
You are right ::) FT is not working as expected, I'll create a sample app that replicates this leak and post it to the FT devel list. In any case it's not a critical leak as it only happens when loading fonts, which is normally just at the start of the app.

2
Graphics / Re: Memory Leak on Font::loadGlyph
« on: November 12, 2016, 07:08:47 pm »
It might be a bug with that parameter in FT. In my tests I changed that to 0, leaving it at one didn't clear the memory, and trying to clear manually with 1 gave some other errors. The 1 there seems to free some resources but not all, that's the original concern of the mailing list post.

Running though valgrind is really clear there's a memory leak there. If you want, I can post a PR with some more detailed valgrind logs so you can see how it changes before and after.

3
Graphics / Re: Memory Leak on Font::loadGlyph
« on: November 12, 2016, 09:58:28 am »
The problem is that FT_Glyph_To_Bitmap at https://github.com/SFML/SFML/blob/master/src/SFML/Graphics/Font.cpp#L559 changes the glyphDesc pointer to a new value, the original one is lost. The solution is to save a copy and free both at the end of the function.

4
Graphics / Memory Leak on Font::loadGlyph
« on: November 12, 2016, 05:57:20 am »
Hello,

I've been running a sample app through valgrind and I see that sf::Font::loadGlyph is leaking memory. According to https://lists.nongnu.org/archive/html/freetype-devel/2008-08/msg00014.html the call to FT_Glyph_To_Bitmap creates a new glyph that needs to be free'd with FT_Done_Glyph. Doing that, that particular leak is gone.

I have a patch ready to be submitted that fixes this leak, should I open a PR on github for that?

Thanks!
César

Pages: [1]