mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 16:58:09 +02:00
Improve at exit cleanup functions
Now they are run in a defined order not based on the order of initialization
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "state.h"
|
||||
#include "cleanup.h"
|
||||
#include "fonts.h"
|
||||
#include "unicode-data.h"
|
||||
#include <structmember.h>
|
||||
@@ -608,10 +609,7 @@ init_CoreText(PyObject *module) {
|
||||
if (PyType_Ready(&CTFace_Type) < 0) return 0;
|
||||
if (PyModule_AddObject(module, "CTFace", (PyObject *)&CTFace_Type) != 0) return 0;
|
||||
if (PyModule_AddFunctions(module, module_methods) != 0) return 0;
|
||||
if (Py_AtExit(finalize) != 0) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Failed to register the CoreText at exit handler");
|
||||
return false;
|
||||
}
|
||||
register_at_exit_cleanup_func(CORE_TEXT_CLEANUP_FUNC, finalize);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user