Ronald Oussoren <ronaldousso...@mac.com> added the comment:
The attached code creates a static (global) C++ object that owns a reference to a Python object, and releases that reference in its destructor. That destructor runs at program termination, which is after interpreter shutdown (that is after Py_FinalizeEx is called). After the call to Py_FinalizeEx() the interpreter no longer exists, and it is unsafe to call Python API functions (other than the ones listed as safe to call before a call to Py_Initialize). Py_DECREF is not on that safe list. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38609> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com