finalize the fontconfig library on exit

This commit is contained in:
Kovid Goyal 2017-09-28 11:06:56 +05:30
parent cda385b37c
commit 150ffab72d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -85,6 +85,10 @@ init_fontconfig_library(PyObject *module) {
PyErr_SetString(PyExc_RuntimeError, "Failed to initialize the fontconfig library");
return false;
}
if (Py_AtExit(FcFini) != 0) {
PyErr_SetString(PyExc_RuntimeError, "Failed to register the fontconfig library at exit handler");
return false;
}
if (PyModule_AddFunctions(module, module_methods) != 0) return false;
return true;
}