Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed slight memory leak in sf::Font #1216

Closed
wants to merge 2 commits into from
Closed

Fixed slight memory leak in sf::Font #1216

wants to merge 2 commits into from

Conversation

dermoumi
Copy link
Contributor

@dermoumi dermoumi commented Apr 7, 2017

Nothing much, but apparently it's all i'm good at 馃槥 ( see #509 )

There is also an inconsistency in the coding style; Either adding objects to the class as soon as they're created so that cleanup() frees them eventually, as is the case with the stroker object, which is cleaner IMO. Or adding them at the very end and having to clean every single one whenever there's an error loading, as it's the case with original code, this frees memory instantly but irrelevant if there's no errors (most of the time).

But I did not touch that.

Copy link
Member

@LaurentGomila LaurentGomila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I don't like these functions, we should invest some time trying to make them cleaner and more robust.

In the meantime, your fix is ok, and I think you can also add a call to FT_Done_Face(face) when FT_Stroker_New fails.

@eXpl0it3r eXpl0it3r removed the request for review from binary1248 April 7, 2017 09:58
@eXpl0it3r eXpl0it3r added this to Discussion in SFML 2.5.0 Apr 11, 2017
@dermoumi
Copy link
Contributor Author

There! I hope this will do.

@eXpl0it3r eXpl0it3r moved this from Discussion to Ready in SFML 2.5.0 Apr 25, 2017
@eXpl0it3r
Copy link
Member

Squashed and merged the commits in c43b599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SFML 2.5.0
  
Merged / Superseded
Development

Successfully merging this pull request may close these issues.

None yet

3 participants