-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 for memory leaks in font handling #2634
Conversation
_imaging.c
Outdated
@@ -2196,6 +2215,7 @@ _font_getmask(ImagingFontObject* self, PyObject* args) | |||
im = ImagingNew(self->bitmap->mode, textwidth(self, text), self->ysize); | |||
if (!im) { | |||
return NULL; | |||
free(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After return
I'm not sure what's up with the Travis errors, as they're non-deterministic. This fails on debian-stretch in one commit or ubuntu-trusty-x86 in another, but the changes should not affect them.
(and when rerun, the ubuntu version passed, and the debian one still failed) |
9cb29f2
to
9295674
Compare
9295674
to
b2cd6aa
Compare
This PR now has refactored out a PillowLeakTestCase into helper.py. It's got the current cross platform correct version of the get_mem_usage code from the png leak test case. We should convert the other memory checkers to this helper, so that they use the correct code. |
Fixes #2629 .
Changes proposed in this pull request: