diff --git a/freetype/__init__.py b/freetype/__init__.py index 4b65985..cbef885 100644 --- a/freetype/__init__.py +++ b/freetype/__init__.py @@ -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 )