> While working with mxTextTools 2.1.0b2, Mike Fletcher found that > he gets a fatal error when the interpreter exits. > > Some tracing indicates that the cause is the at exit function > of mxTextTools which clears the cache of tag tables used by > the Tagging Engine in mxTextTools. > > If these tables include references to (callable) Python instances, > Python can't properly clean them up when decref'ing them at > AtExit time. > > Would it be safe to simply move the call_dll_exitfunc() > call just before the "clear threat" code in Py_Finalize() ? You mean call_ll_exitfuncs(). :-) I think you may be making a wrong use of Py_AtExit(). The docs state (since 1998): Since Python's internal finallization will have completed before the cleanup function, no Python APIs should be called by *func*. I don't think it's safe to move the call forward. (I don't know which line you are referring to with ``"clear threat" code'' so I don't know how far back you want to move it, but I think the intention is very clear that this should be done at the very last.) You may want to use the atexit.py module instead to schedule your module's cleanup action; these exit functions are called much earlier. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4