Skip to content

Commit

Permalink
Merge pull request #171 from carandraug/169-check-ft-face-done
Browse files Browse the repository at this point in the history
freetype.Face.__del__: check first if FT_Face_Done has been set to None (#169)
  • Loading branch information
rougier authored Jun 1, 2023
2 parents ccd4f5f + d592262 commit 6df2d3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion freetype/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,9 @@ def __del__( self ):
'''
Discard face object, as well as all of its child slots and sizes.
'''
if self._FT_Face is not None:
# We check FT_Done_Face because by the time we're called it
# may already be gone (see #44 and discussion in #169)
if FT_Done_Face is not None and self._FT_Face is not None:
FT_Done_Face( self._FT_Face )


Expand Down

0 comments on commit 6df2d3d

Please sign in to comment.