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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FT_Done_FreeType never being called on FT_Library instance. #21

Merged
merged 2 commits into from Feb 15, 2015

Conversation

mdsitton
Copy link
Contributor

In python 2 the injected del method was called, but by the time FT_Library was deleted the FT_Done_FreeType function was gone. This has been worked around by storing a reference of FT_Done_FreeType.

However under python 3 there was a second issue. For whatever reason the injected del method wasn't called at all. They work on a normal classes and subclasses in python 3, so I'm not completely sure what was going on there. Fixed this by just subclassing FT_Library, and defining the needed stuff in there.

This also has a nice side effect of no longer injecting the del function into the raw FT_Library, which also effected anyone using freetype raw.

if error: raise FT_Exception(error)

try:
set_lcd_filter( FT_LCD_FILTER_DEFAULT )
Copy link
Owner

Choose a reason for hiding this comment

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

While reading your patch, I wonder why I put this specific initialisation code here. In any case, we should not silence the exception.

@mdsitton
Copy link
Contributor Author

I agree, also set_lcd_filter It also happens eventually to loop back and call get_handle before _init_freetype() returns.

@mdsitton
Copy link
Contributor Author

It was added in this commit: 2fc2636

@mdsitton
Copy link
Contributor Author

mdsitton commented Feb 1, 2015

Any status on merging?

@rougier
Copy link
Owner

rougier commented Feb 15, 2015

Sorry for the delay.

rougier added a commit that referenced this pull request Feb 15, 2015
Fix FT_Done_FreeType never being called on FT_Library instance.
@rougier rougier merged commit b528caa into rougier:master Feb 15, 2015
This was referenced May 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants