File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,19 @@ PyObject *freetypy_module;
80
80
static void
81
81
freetypy_module_dealloc (PyObject * m )
82
82
{
83
- FT_Done_FreeType (ft_library );
83
+ /*
84
+ This doesn't always work because sometimes this module is
85
+ freed before all of the Face objects have been destroyed.
86
+ FT_Done_FreeType will try to free all open FT_Faces, and
87
+ then the Py_Face destructors will try to free those again.
88
+ In matplotlib, the old freetype wrapper never called
89
+ FT_Done_FreeType (and even worse, there was no way to do
90
+ that from Python 2.x) and it was never a real problem. So
91
+ the easiest way to fix this is to just not call this and
92
+ let the OS clean up on process ending, and let Python free
93
+ the Face objects as it is done with them.
94
+ */
95
+ // FT_Done_FreeType(ft_library);
84
96
}
85
97
86
98
static struct PyModuleDef moduledef = {
You can’t perform that action at this time.
0 commit comments