Search code examples
pythonpython-c-apipython-c-extension

Python C-API module exit handler - an atexit equivalent?


I'm using Python ver 2.6.4

There is a function I have to call from a C library when my extension module exits/is unloaded. What would be the equivalent of atexit for a C extension module?


Solution

  • The Py_AtExit() function can be used to register up to 32 cleanup functions.