8000 Fix leak of filedescriptor if fontsize cannot be set. · matplotlib/matplotlib@79218df · GitHub
[go: up one dir, main page]

Skip to content

Commit 79218df

Browse files
committed
Fix leak of filedescriptor if fontsize cannot be set.
Closes #7922 Should prevent resources warnings from poping up in scipts of the type: import warnings warnings.simplefilter('default') from matplotlib.ft2font import FT2Font FT2Font('/System/Library/Fonts/Apple Color Emoji.ttf')
1 parent f41ef96 commit 79218df

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ft2font.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ FT2Font::FT2Font(FT_Open_Args &open_args, long hinting_factor_) : image(), face(
508508

509509
error = FT_Set_Char_Size(face, 12 * 64, 0, 72 * (unsigned int)hinting_factor, 72);
510510
if (error) {
511+
FT_Done_Face(face);
511512
throw "Could not set the fontsize";
512513
}
513514

0 commit comments

Comments
 (0)
0